Essentially you original rewrite rule was taking any URL under your
domain and mapping it at your /index.php file regardless of anything
else, therefore apache was never even trying to look for your public
directory.
The two conditions added before the rules
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
tell mod_rewrite not to apply the rewrite rule if any physical file (-
f) or direcotry (-d) exist - which solves your problem.
Nick
On 22 Aug 2007, at 15:36, TravisJ wrote:
Thank you Nick,
This worked perfectly. I don't know why what I was doing didn't
work, but your suggestion worked well.
Nick Thornley-2 wrote:
In the base directory I would add rewrite conditions checking that
the directory/file being requested is not a real directory or file.
This way any real file/dir you add under your web root will bypass
the ZF rewrite rule entirely.
For example:
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
Nick
On 20 Aug 2007, at 17:42, TravisJ wrote:
I've been having trouble setting up my server so that I can have a
public
directory that is not affected by mod_rewrite.
the relevant file structure is:
.htaccess
/app/
/lib/
/www/
/www/index.php
/public/
/public/.htaccess
the base directory .htaccess has:
RewriteEngine on
RewriteRule .* www/index.php
the public directory .htaccess has:
RewriteEngine off
The rewrite engine seems to work to get my bootstrap and related
application
files working just fine. But it won't turn off for my public
directory and
still loads the bootstrap and Zend Controller. This is a shared
server (via
dreamhost).
Any ideas?
--
View this message in context: http://www.nabble.com/Problems-
setting-up-RewriteEngine-tf4300042s16154.html#a12239422
Sent from the Zend Framework mailing list archive at Nabble.com.