htaccess code for maintenance page redirect

Posted by Force Flow on Pro Webmasters See other posts from Pro Webmasters or by Force Flow
Published on 2012-12-06T20:48:52Z Indexed on 2012/12/06 23:27 UTC
Read the original article Hit count: 452

Filed under:
|

I set up a maintenance page that I could enable through an htaccess file. The html file is located in a folder called "maintenance".

The html file has some images in it. However, visitors to the page see no images, even though I added a line to allow them.

If I try to visit an image in the browser directly, it redirects to the maintenance.htm page.

Am I missing something?

# Redirects visitors to maintenance page except for specific IP addresses
# uncomment lines when redirecting visitors to maintenance page; comment when done. 
# Also see the section on "redirects visitors from maintenance page to homepage"
#
#RewriteCond %{REMOTE_ADDR} !^127.0.0.1$
#RewriteCond %{REMOTE_ADDR} !^111.111.111.111$
RewriteCond %{REQUEST_URI} !/maintenance/maintenance\.htm$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|png|gif|css|ico)$ [NC]
RewriteRule ^(.*)$ /maintenance/maintenance.htm [R=302,L]
#
# end redirects visitors to maintenance page

# Redirects visitors from maintenance page to homepage
# comment lines when redirecting visitors to maintenance page; uncomment when done
#
#Redirect 301 /maintenance/maintenance.htm /
#
# end redirects visitors from maintenance page to homepage

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about apache2