I'm managing an e-commerce site for a customer that was built using JShop on Apache. For SEO reasons links are like:
http://www.domain.com/shop/section/3151/1/flowers
http://www.domain.com/shop/product/35465/blueflower
which get mapped to:
http://www.domain.com/shop/section.php/3151/1/flowers
http://www.domain.com/shop/product.php/35465/blueflower
which give the same pages as:
http://www.domain.com/shop/section.php?xSec=3151&xPage=1
http://www.domain.com/shop/product.php?xSec=35465
Somehow this is achieved without mod_rewrite (I have confirmed this by disabling mod_rewrite and commenting out all rewrite rules in all conf and .htaccess files).
Note: The files section.php and product.php exist, but section and product do not, nor are there symlinks.
The problem is that on the production server this behavior stopped happening. On my dev server it still works. I was able to get the production server working correctly again by using mod_rewrite since this is the only way I know how to do this. However I really need to know what changed on the production server in the first place so I can properly understand the problem (to avoid other unforeseen consequences). I have restarted Apache and undone all changes I was making on the production server at the time the URLs became broken. They are still broken (without my new rewrite rules).
What methods other than mod_rewrite can be used to remove .php extensions from URLs?
Content Negotiation can do this. Enable
MultiViews
forshop
folder:When the server receives a request
/shop/section/3151/1/flowers
(section
does not exist), it will look up forsection.*
inshop
folder, sort based on the media types and content-encodings send by the browser and choose the best match.Mod_alias, perhaps. Something like:
It could be using
PATH_INFO
- more details here.