Jump to content

Multiple URL / File ReWrite


deadsilent

Recommended Posts

I have a similar question on the same matter. I'm wonder how I can use multiple RewriteRules for different files.. currently I am only able to Rewrite one and if I use any more they either dont work or will cause an error.. here is the code I'm using:

 

<IfModule mod_rewrite.c>
  Options +FollowSymlinks
  RewriteEngine on  
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ link.php?get=$1 [L,QSA]
</IfModule>

 

I'd like to add the code below for basic actions:

 

RewriteRule ^(.*)$ index.php?do=$1 [L,QSA]

 

then i'd like to have this one

 

RewriteRule ^(.*)$ index.php?do=$1&search=$2&type=$3&page=$4 [L,QSA]

 

which turns out like: /search/$2

 

If you could give me some help as well that would be great.. I'm starting to learn this stuff but I still dont get it.. :\

 

Thanks guys.

Link to comment
Share on other sites

You can't rewrite *everything* to 3 different URLs....  You will need some kind of system to know what page is desired.

 

 

Perhaps something like:

 

RewriteRule ^some_folder/(.*) /some_page.php?var=$1

 

 

(With stuff that makes sense put in, obviously.)

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.