views:

219

answers:

1

Hey there SO,

I'm using the Zend Framework, so I'm bootstrapping into a file called index.php. Naturally, I don't want images to be bootstrapped, so I've added a .htaccess file. Here's what it looks like

/application
/library
/public (this is the root of the site)
     /images
     /js
     .htaccess
     index.php

This is what's written in my .htaccess:

RewriteEngine on
RewriteRule !\.(js|ico|gif|jpg|png|mp3|mov|css)$ index.php

This is basically saying if it doesn't end in .js / .ico / etc, then send the request to index.php. It works just fine on my localhost, but when I get up to actually putting it online, it doesn't. It just routes everything to index.php, regardless of the ending of the request. When mywebsite.com/images/wizard.gif should just show the picture, it tries to load the images controller, which is not what I want it to do.

What could be going wrong? I know it's reading the .htaccess. Is it reading my regex wrong? Why would one apache server read it wrong, while another reads it correctly? Any help would be great.

A: 

Here is my .htaccess if you would like to give it a try:

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

Basically it checks to make sure the request is not a directory, symlink or a real file, and then sends it to index.php. Otherwise it will provide direct access to the file/directory

Mark
it seems to have the same problem. I must be doing something else wrong...
Ethan