Differences
This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
apache:maintenance-redirect [2011-04-06 18:48:05] shaun.reitan created |
apache:maintenance-redirect [2011-05-13 23:58:44] garrett.plasky Approved |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== Putting your site into Maintenance Mode ====== | + | ====== Putting your Site into Maintenance Mode ====== |
There are times when you want to disable access to your site. You could simply add a 'deny from all' to your .htaccess page but this gives the end user a ugly forbidden page and makes your site look broken. | There are times when you want to disable access to your site. You could simply add a 'deny from all' to your .htaccess page but this gives the end user a ugly forbidden page and makes your site look broken. | ||
Line 8: | Line 8: | ||
===== Instructions ===== | ===== Instructions ===== | ||
- | - Create | + | - Create |
- | - In the root of your site create (or edit) the .htaccess file and add the following lines. | + | - In the root (public_html/ |
- | <code console> | + | |
Options +FollowSymlinks | Options +FollowSymlinks | ||
RewriteEngine On | RewriteEngine On | ||
Line 17: | Line 16: | ||
RewriteCond %{REMOTE_ADDR} !^10.0.0.1$ # Change this to your ip address so that you can bypass the redirect | RewriteCond %{REMOTE_ADDR} !^10.0.0.1$ # Change this to your ip address so that you can bypass the redirect | ||
RewriteRule .* / | RewriteRule .* / | ||
- | </code> | + | </sxh> |
- | + | ||
- | Your site should now redirect users to the maintenance.html page when they visit your site. Remember that if you added your ip address to the filter that the redirect wont happen when you visit the site. If you want to test the redirect you can comment out that line using a #. | + | |
+ | Your site should now redirect users to the maintenance.html page when they visit your site. Remember that if you added your IP address to the filter that the redirect wont happen when you visit the site. If you want to test the redirect you can comment out that line using a #. | ||
+ | {{tag> |