Mobile app version of vmapp.org
Login or Join
Sue5673885

: 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

@Sue5673885

Posted in: #Apache2 #Htaccess

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} !^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]

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Sue5673885

1 Comments

Sorted by latest first Latest Oldest Best

 

@Si4351233

I haven't tested but here is some suggestions for you to try :


Put an other .htaccess in the /maintenance/ folder with a RewriteEngine Off to disable the redirection of images once in this folder.
Make a sub-domain for your maintenance site and redirect everything to this sub-domain with this temporary redirection in your .htaccess located in your main domain : Redirect 302 / www.maintenance.mydomain.com/ it'll be more logical as a maintenance site is a website inside of an other, and sub-domains are meat to be used for creating different sites inside an other..


Hope it'll work ! :)

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme