|
|||
|
This is on OS X.
I'm able to get ZF working fine when I only have an IndexController, but calling anything else gives me a 404. The problem is, I'm not being redirected to the bootstrap index.php file. My browser is searching for an actual directory, so my rewrites aren't working. I've tried every tip I've found, but nothing works. Here's my setup: In httpd.conf, mod_rewrite is loaded: Code:
LoadModule rewrite_module libexec/httpd/mod_rewrite.so Code:
AllowOverride All Code:
<VirtualHost zend.dev:80> DocumentRoot /Users/me/Sites/conventional/document_root ServerName zend.dev </VirtualHost> Code:
RewriteEngine on RewriteRule !\.(pdf|php|js|ico|txt|gif|jpg|png|css|rss|zip|tar\.gz)$ index.php But when I try my FooController, http://zend.dev/foo, I get 404 Not Found. I can actually type the index page directly, and it works: http://zend.dev/index.php/foo ... so it seems my .htaccess file just isn't kicking in. What am I missing? Thanks for any help. One more note: I tried doing all this in my httpd.conf file as suggested in the wiki, Code:
<VirtualHost zend.dev:80>
DocumentRoot /Users/me/Sites/modular/document_root
ServerName zend.dev
RewriteEngine off
<Location />
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|php|js|ico|txt|gif|jpg|png|css|rss|zip|tar\.gz)$ /index.php
</Location>
</VirtualHost>
|
|
|||
|
Fixed the 404 issue.
I had 'AllowOverride All' inside here: Code:
<Directory "/Library/WebServer/Documents"> Code:
<Directory /Users/me/Sites/*> Options FollowSymlinks AllowOverride All </Directory> Hm, also, it now looks like the 403 issues with putting all the mod_rewrite stuff inside httpd.conf are gone by adding this directory directive. (I moved my .htaccess file, and it still seems to be working correctly.) Hope this helps any OS X user out there: 1. Set up your virtual host so you can get to your document root without any slashes (which will be interpreted as controllers, etc.). 2. Make sure to add a <Directory> for your Sites folder with AllowOverride All. Last edited by purp : 09-03-2007 at 03:23 PM. Reason: Added info about 403 success |
![]() |
| Thread Tools | |
| Display Modes | |
|
|