lordphate Posted January 3, 2008 Share Posted January 3, 2008 Hey everyone I'm trying to make multiple modrewrite rules but as soon as i add more than one the others stop working... here's what i'm trying to do Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^.]+)\.html index.php?page=$1 RewriteRule ([^.]+)-([^.]+)\.html index.php?page=$1§ion=$2 RewriteRule ^([^.]+) profiles/index.php?folder=$1 [L] If i remove the ?page=$1 and/or ?page=$1§ion=$2 then profiles will work, but if i remove the profiles ?page=$1 will work but the ?page=$1§ion=$2 never works Any one have a suggestions and i'll be adding alot more after this Quote Link to comment Share on other sites More sharing options...
lordphate Posted January 3, 2008 Author Share Posted January 3, 2008 OKay i kinda have this working Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/ profiles/index.php?folder=$1&%{QUERY_STRING}$ RewriteRule ([^.]+)\.html index.php?page=$1&%{QUERY_STRING}$ RewriteRule ([^.]+)-([^.]+)\.htm index.php?page=$1§ion=$2&%{QUERY_STRING}$ Works but i have to use / at the end of the profiles rewrite , i have to seperate the page=§ion with .htm not .html because that won't work... ideas? Quote Link to comment Share on other sites More sharing options...
madmax Posted January 8, 2008 Share Posted January 8, 2008 If using .htaccess then you have no RewriteBase specified so it's kinda hard to debug without knowing what context you're using these rules in. Also the 2nd example has no last rule flag [L] Might be better to state what you're trying to actually achieve in the first place as there might be a simpler or possibly more robust and easier-to-debug method of doing the job. One could debug the syntax of your current rule only to find that it still doesn't do what you really want it to. (and up to know you've not clearly stated what you're trying to achieve) Are you simply trying to redirect to (or rewite to) physical folder by use of parameters? If so then see ttp://www.phpfreaks.com/forums/index.php/topic,175410.0.html Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.