View Full Version : Please help: .htaccess (created by zend fw) causing 403 error.

05-03-2011, 07:47 PM
I've been struggling with this for almost a week now, and I've finally found the root of my problem (I am sooo excited!!).
It's my .htaccess file. What a relief! (I'm running WAMP on Win XP, if it matters.)

I'm new to the Zend Framework (and totally green on Apache), and I'm trying to follow a set of tutorials, but when I create a project, I can't see it from my browser.
I get a 403 error: Forbidden You don't have permission to access / on this server .

When I rename the .htaccess file to something non-consequential, I can suddenly get into the public directory (even if with: "Fatal error: require_once() [function.require]: Failed opening required ...").
Here are the contents of that default htaccess file:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

Can anyone see what would be causing the 403 error?

~ Mo

For posterity sake (and to help with google searches), here's the big picture:
I tried a million things. From creating the projects multiple ways (from the command line and from within netBeans) in many different locations on several different drives (I guess wamp doesn't like it when a VH dir is on a mapped network drive), to playing with the httpd-vhosts.conf file, to wrestling with windows permissions (which, by the way, has some black-magic-voodoo going on with it's psuedo-readOnly attribute), to ... so many other things I can't remember them all right now :).

Finally, I tried to just create an alias to the parent directory of one of my many ZF test projects, and I could see all sub-dir's except for public. So, through a process of elimination, I came to pin down the culprit. Oh, what a relief !!

11-23-2011, 06:26 PM
Just a very belated follow-up (I'm setting up a new machine for myself right now, and faced the same issue as last time, so in reviewing my notes, I noticed that this post could use a little more info.)

Don't forget to enable the mod_rewrite extension in the apache configuration (httpd.conf).
Remember to add the Z-FW as an item of your include_path in your php.ini.

~ Mo