Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm managing an e-commerce site for a customer that was built using JShop on Apache. For SEO reasons links are like:

which get mapped to:

which give the same pages as:

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?

share|improve this question
up vote 5 down vote accepted

Content Negotiation can do this. Enable MultiViews for shop folder:

<Directory "/path/to/shop">
    Options FollowSymLinks +MultiViews
    AllowOverride None
    Order allow,deny
    Allow from all

When the server receives a request /shop/section/3151/1/flowers (section does not exist), it will look up for section.* in shop folder, sort based on the media types and content-encodings send by the browser and choose the best match.

share|improve this answer
Wow, thanks, this was exactly the reason. I never knew MultiViews worked this way. – rwired Sep 13 '11 at 11:41

Mod_alias, perhaps. Something like:

AliasMatch ^/shop/section/(.*)/(.*)/(.*)$ /shop/section.php?xSec=$1&xPage=$3
AliasMatch ^/shop/product/(.*)/(.*)$ /shop/product.php?xSec=$1
share|improve this answer

It could be using PATH_INFO - more details here.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.