I am using following rewrite rule for some pages of my shopping cart site. At the moment it works for seo_page.php?id=value only. Whenever i try to access special_offer.php?id=value it does not work and apache apply only first rule that is for seo_page.php. I want to add rules for at least 5 files. Is it possible.
I think you can't do it like in your example. RewriteRule ^(.*).html$ /seo_page.php?cn=$1 could give /1.html RewriteRule ^(.*).html$ /special_offer.php?cn=$1 could give /1.html so the sites are not unique... you should try something like this: RewriteEngine on RewriteRule ^(.*)_([0-9]+)\.html$ http://www.domain.com/$1.php?cn=$2 Code (markup): This should give out this: seo_page_1.html special_offer_1.html (not tested)
Thanks for help. I don't want 'special_offer' in url. Instead of passing IDs in url (1,2,3...) I want to send keywords in url so request to site.com/special_offer.php?id=crib should be like site.com/crib.html.
RewriteRule ^(.*).html$ /seo_page.php?cn=$1 [L] RewriteRule ^(.*).html$ /special_offer.php?cn=$1 [L] Code (markup): MAybe with an [L] flag at the end...
No friend, It did not work. It is still going to seo_page.php. special_offer page's rewrite rule is not working.
You'll have to change the URL for one of the scripts. You can't give two scripts the exact same fake URLs. It's like trying to fit two gallons of milk in a gallon container. Only one will fit.