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

Running Apache on Mac Snow Leopard (ie Web sharing enabled).

Paths are evaluating in ways not expected: is returning a file (sans exception) instead of a folder.

If I make a call to and I have a file events.php in my root directory, Apache returns that page, and the rest of the path is ignored.

Furthermore, this call takes precedence over the commands in .htaccess

eg. I need to redirect to
Apache returns without the requisite argument.

RewriteEngine on
RewriteRule ^events/(.+)/?$ events.php?month=$1

If the events.php doesn't exist (let us say it is called eventsHandler.php), then the above rewriteRule works wonderfully. So I know it is not an issue with the .htaccess

I've tried to make file extensions visible, it has not helped.

So the questions are:

  1. Why does Apache on Mac drop the file extension and treat the file as a folder?
  2. Why doesn't the .htaccess overrule this?
  3. How do I fix this, that it should just work?
share|improve this question

migrated from Apr 15 '11 at 15:50

This question came from our site for computer enthusiasts and power users.

On MacOS, a slash ("/") is a valid character for use in filenames and is not a path delimiter. Try using a colon for the path delimiter instead.

Also, be sure to test your paths in all the code you depend on because you may occasionally encounter some code that will try to automatically convert paths after detecting the OS. We ran into some issues like this back in the Novell NetWare days (not with NetWare, which supported multiple file system naming conventions on a single volume by adding something called a "namespace" on the server-side, but with third-party tools and libraries that can sometimes introduce confusion).

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.