Webmasters Stack Exchange is a question and answer site for pro webmasters. 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 trying to get mod rewrite to work on my Mac. This is the content of the .htaccess file:

<Files *\.ini>
  order allow,deny
  deny from all

RewriteEngine on
RewriteRule .* index.php

I know this is active, because it's blocking .ini files properly, and it seems to rewrite the fictional request /foo to index.php, as this is the error I'm seeing in the browser:

The requested URL /Users/rwel/Sites/dev/quaestio/index.php was not found on this server.

The index.php file currently just contains an exit statement for testing purposes, and it does work when calling it directly. So, the question is, what's going wrong? I went into the apache error log, and this is what I saw:

[Thu Nov 03 14:36:02 2011] [error] [client] File does not exist: /Library/WebServer/Documents/Users

So the problem might be that it's not searching in the root, but relative to the /Library/WebServer/Documents directory. Am I right? How can I fix this?

share|improve this question

Since Rijk didn't want to answer their own question, the solution was they had to add this line into the .htaccess file.

RewriteBase /~rwel/dev/quaestio

Hope this helps someone else.

share|improve this answer

How about redirect to a simple html file and see if that works?

Also try using this syntax:

RewriteRule ^.*$ /index.php

share|improve this answer
Thank you, I tried but this didn't have the desired effect. I found that it did work after adding this line: RewriteBase /~rwel/dev/quaestio. How come I don't have to do this on the Debian servers? – Rijk Nov 3 '11 at 15:39
@Rijk You're allowed to answer your own question, so I suggest you do that. – paulmorriss Nov 3 '11 at 17:09

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.