Jump to content

Multiple RewriteRule's seem to be Conflicting


ncovill

Recommended Posts

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&currentpage=$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&currentpage=$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!

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&currentpage=$2 [L]

RewriteRule ^index/([a-zA-Z0-9_-]+)/page=([0-9_-]+)$ /index.php?order=$1&currentpage=$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/

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.