3

I have set up in my .htacces file so that anyone trying to visit the site gets redirected to index.html, which is an under construction page. I have an image on there, that doesnt display cos the link gets redirected to index.html, how do i exclude the image from the rule, the path is /images/underConstruction.png.

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/index.html
RewriteRule ^ /index.html [R=301]
RSM
  • 14,540
  • 34
  • 97
  • 144
  • Try this: http://stackoverflow.com/questions/1848500/htaccess-mod-rewrite-how-to-exclude-directory-from-rewrite-rule – androbin Sep 23 '12 at 15:52

2 Answers2

3

Add a exclusion condition to your rules:

RewriteEngine On
RewriteCond %{REQUEST_URI} !=/images/
RewriteCond %{REQUEST_URI} !=/index.html
RewriteRule ^ /index.html [R=301]
Jon Lin
  • 142,182
  • 29
  • 220
  • 220
1

try to add this line

RewriteRule ^images/ - [L]
DTukans
  • 339
  • 2
  • 7
  • if i put it below last line dont work, if i put it above last line, its a redirect loop – RSM Sep 23 '12 at 13:12