sabecs
asked on
.htaccess rewrite rules work seperately but not together?
I have a couple of rules in my .htaccess file that work OK on their own but not together?
If I comment one out the other works and vise versa?
Your feedback would be appreciated.
If I comment one out the other works and vise versa?
Your feedback would be appreciated.
http://www.mywebsite.com.au/241/Services/Services.html
RewriteRule ([0-9]+)(.*)\.html$ index.php?page_id=$1
http://www.mywebsite.com.au/index.php?page_id=241
http://www.mywebsite.com.au/item_details/1147/Web-Design.html
RewriteRule ^([^/]*)/([^/]*)/([^/]*)\.html$ /index.php?page=$1&id=$2&new_page_title=$3 [L]
http://www.mywebsite.com.au/index.php?page=item_details&id=1147&new_page_title=Web-Design
You need a RewriteCond for which Rule applies.
ASKER
Thanks GaryC123, but how/where do I add that?
I'm not sure what it is you are trying to do?
You are rewriting seo friendly urls to non friendly?
What condition should be there for the two rewrites?
You are rewriting seo friendly urls to non friendly?
What condition should be there for the two rewrites?
ASKER
The URL displayed in browser is
http://www.mywebsite.com.au/241/Services/Services.html
I then rewrite it to get the page_id of 241 and pass it to my PHP page which extract content from my MySQL table based on this page id.
I hope that makes sense?
http://www.mywebsite.com.au/241/Services/Services.html
I then rewrite it to get the page_id of 241 and pass it to my PHP page which extract content from my MySQL table based on this page id.
I hope that makes sense?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks Gary, that works perfectly....Cheers.. Andredw