View Full Version : htaccess to set a full website redirect to an "under maintenance" page

10-03-2012, 07:50 PM
Hi All

I have a friend who wants me to redesign their website as it currently holds incorrect information, the best way i though of doing this is to have a full site redirect to a "website under maintenance" using the .htaccess file

so no matter which page the user trys to access it will always redirect to the maintenance.php page

can anyone help me with this please?

10-03-2012, 07:56 PM
ok i've got it working

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{REMOTE_ADDR} !^123\.456\.789\.000
RewriteCond %{REQUEST_URI} !/maintenance.html$ [NC]
RewriteCond %{REQUEST_URI} !\.(jpe?g?|png|gif) [NC]
RewriteRule .* /maintenance.html [R=302,L]

seems to work, but how do i prevent the full url from being displayed in the address bar, every pge redirects to www.mywebsite.com/maintenance.html but i dont want to show the /maintenance.html part how do i go about doing that please?

also i dont want google to crawl just the maintenance page but all of the other pages too is this possible?

many thanks