ncovill Posted February 9, 2010 Share Posted February 9, 2010 Hey all, For some reason a few of my RewriteRule's seem to be conflicting with one another. I have several rules, but these are the conflicting ones: RewriteRule ^([a-zA-Z0-9_-]+)/page=([0-9_-]*)$ /pages.php?cat_id=$1¤tpage=$2 [L] RewriteRule ^([a-zA-Z0-9_-]+)$ /pages.php?cat_id=$1 [L] The rule above works fine (i can go to /category fine, it goes to the proper page and everything). But once I add in: RewriteRule ^([a-zA-Z0-9_-]+)$ /index.php?order=$1 [L] RewriteRule ^([a-zA-Z0-9_-]+)/page=([0-9_-]+)$ /index.php?order=$1¤tpage=$2 [L] The first part stops working (the pages.php rule), but these new rules work fine (the ?order= rules)... The ?order= rules are above the pages.php rule in my .htaccess file, but when I put the order rule below the pages.php rule, then the categories rule works fine, while the order rule no longer does... so confused :/ As always, any kind of help is appreciated! Quote Link to comment https://forums.phpfreaks.com/topic/191428-multiple-rewriterules-seem-to-be-conflicting/ Share on other sites More sharing options...
strago Posted February 16, 2010 Share Posted February 16, 2010 Two scripts can't have the same URLs. You need to give them something unique in the URL, like RewriteRule ^page/([a-zA-Z0-9_-]+)/page=([0-9_-]*)$ /pages.php?cat_id=$1¤tpage=$2 [L] RewriteRule ^index/([a-zA-Z0-9_-]+)/page=([0-9_-]+)$ /index.php?order=$1¤tpage=$2 [L] RewriteRule ^page/([a-zA-Z0-9_-]+)$ /pages.php?cat_id=$1 [L] RewriteRule ^page/([a-zA-Z0-9_-]+)$ /index.php?order=$1 [L] and I would suggest also changing /page= to /page/ Quote Link to comment https://forums.phpfreaks.com/topic/191428-multiple-rewriterules-seem-to-be-conflicting/#findComment-1013018 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.