tags:

views:

65

answers:

1

Whats supposed to happen:

Any file requests in the root directory that are on the list are to be processed as is.

Any file requests in the /images/ directory are to be processed as is.

Anything else passed to the root directory (just the root directory) should be sent to viewpic.php?id= and then the request

What IS happening:

Everything above is working, except when i attempt to visit an image from the /images/ directory it doesnt display, and instead displays my site index.

My .htaccess file

RewriteEngine On 
RewriteCond %{REQUEST_URI} !.*\.(gif|jpg|png|css|js|php|swf|xpi|ico|src)$ [OR]
RewriteCond %{REQUEST_URI} "/images/" [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.+) view.php?picid=$1 [L]
+1  A: 

Your current .htaccess file does the following right now, per line:

  1. Activates the Rewrite Engine.
  2. Checks if the file doesn't end one of those extensions, OR
  3. Checks if the request URI is /images/, OR
  4. Checks if the file doesn't exist

Then rewrites... Which is not what you really want. You might want to try the following:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^images/
RewriteRule (.*) view.php?picid=$1 [L]
Andrew Moore
Much thanks, works great.
Patrick