#1
  1. Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2012
    Posts
    204
    Rep Power
    2

    Multiple .htaccess situations?


    Hi.

    I'm getting the grip of .htaccess, but now i'm stuck in a situation where there's multiple redirects needed.

    website/werknemers/5
    website/lijst/5


    Those links should work, redirecting from

    index.php?page=werknemers&klant=5
    index.php?page=lijst&lijst=5


    I'm using the following .htaccess, which is working! but only the one's i put at the top of the document

    Code:
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)/(.*)$ index.php?page=$1&klant=$2 [L]
    
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)/(.*)$ index.php?page=$1&lijst=$2 [L]
    
    	RewriteCond %{REQUEST_FILENAME} !-f
    	RewriteCond %{REQUEST_FILENAME} !-d
    	RewriteRule ^(.*)$ index.php?page=$1 [L]
    Any idea's how to solve this? so that every Get parameter is redirected. Thanks!
  2. #2
  3. CSS & JS/DOM Adept
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jul 2004
    Location
    USA (verifiably)
    Posts
    20,124
    Rep Power
    4304
    The second one matches the exact same conditions as the first and both are using the "last flag".

    Would you please explain more about what you're trying to do so that we might see how to differentiate those conditions?
    Spreading knowledge, one newbie at a time.

    Check out my blog. | Learn CSS. | PHP includes | X/HTML Validator | CSS validator | Common CSS Mistakes | Common JS Mistakes

    Remember people spend most of their time on other people's sites (so don't violate web design conventions).

IMN logo majestic logo threadwatch logo seochat tools logo