While you can find almost anything on the web, we had to resort to our own coding to get .htaccess to redirect only our hosting site, and not all of its minions...
RewriteEngine on
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteCond %{HTTP_HOST} ^(www\.yourdomain\.com)?$
RewriteRule ^(.*)$ http://yourdomain.com/maintenance.html [R=302,L]
To make this work:
1. Replace "yourdomain" with the domain you are taking down.
2. Make a page you want to show others called "maintenance.html", or whatever you want and change "maintenance.html" to your file name in the code.
3. Paste it in .htaccess (or create .htaccess) in your root.
All of your other hosted domains will still work as usual.
Oh, and if you don't have 404 Error handling already...this will point all errors for pages you take offline to the maintenance page:
ErrorDocument 404 /maintenance.html
Thank you to RankingLabs.com for the basic code variables.
If you want more htaccess help and are not tech savvy enough to understand Ranking Labs, we recommend htaccessbasics.com
No comments:
Post a Comment