Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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 am running Apache 2.4.2 on my local server. My website's .htaccess file is as follows:

DirectoryIndex home.php
Options -Indexes
ErrorDocument 404 /404.php

This works great at displaying an HTTP 404 page when you try to access a non-existent file in the browser, but it is not showing the error page when accessing existing files using the following syntax:


For example, if I go to home.php/xyz, the home.php page loads, but all the relative links in the HTML are broken. I don't have a home.php directory on my server! What's going on?

Is there a directive or rule I can add to my .htaccess file to stop this behavior and throw an HTTP 404 error instead?

share|improve this question
up vote 1 down vote accepted

This is a feature called "path_info", and is commonly used to run entire websites from a single CGI script (when better alternatives, such as mod_rewrite, are unavailable).

If the URL causes a CGI script to be treated as a directory, Apache will run that script normally but give it the extra path components in the PATH_INFO environment variable. Many wiki engines use this feature – for example, you can access this way.

This can be controlled using the AcceptPathInfo setting.

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.