SitePoint Sponsor

User Tag List

Results 1 to 4 of 4

Threaded View

  1. #1
    Barefoot on the Moon! silver trophy Force Flow's Avatar
    Join Date
    Jul 2003
    Northeastern USA
    56 Post(s)
    1 Thread(s)

    htaccess code for maintenance page redirect

    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 `RewriteCond` line to (theoretically) allow them.

    If I try to visit the URL of an image file in the browser directly, it redirects to the maintenance.htm page. I do not want image files to be redirected.

    Am I missing something?

        #RewriteCond %{REMOTE_ADDR} !^$
        #RewriteCond %{REMOTE_ADDR} !^$
        RewriteCond %{REQUEST_URI} !/maintenance/maintenance\.htm$ [NC]
        RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|png|gif|css|ico)$ [NC]
        RewriteRule ^(.*)$ /maintenance/maintenance.htm [R=302,L]
    Last edited by Force Flow; Dec 6, 2012 at 22:15.
    Visit The Blog | Follow On Twitter
    301tool 1.1.5 - URL redirector & shortener (PHP/MySQL)
    Can be hosted on and utilize your own domain


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts