I have a website project on my mac book pro leopard, and I am using built in apache2 and php. I’ve made my configurations in both httpd.conf and user.conf to use htaccess. Changes done like :
LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
<Directory >
AllowOverride All
</Directory>
The problem is when i want to open a site like
localhost/~username/site/site/index.php/welcome, index.php does some operations and finds the right controller and the right page.
But when I try to enter site like site/welcome apache gives me the following error :
Not Found
The requested URL Users/username/Sites/site/index.php/welcome was not found on this server.
The problem is apache gets this like it is indeed a file and the error statement gives it in a file system way, but this request must be fetched to index.php instead.
my .htaccess file looks like this
<ifModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php/$1 [NC,QSA,L]
</ifModule>
What bothers me that this configuration works on both Linux and Windows but does not work on Mac. I feel doomed : )
I met the same problem too! ‘DocumentRoot’ doesn’t work for me in Lion.
But this works: