Okay so I tested the page in IE and it seems to work fine, but when I view it in Chrome I get told the page had too many redirects and nothing loads, I have not tried it in Firefox.
So if you try going to http://mckennastudios.com it should bring you to a maintenance.html page.
Here is what I added to my .htaccess file:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteRule $ /maintenance.html [R=302,L]
If there's a better way that's just as easy to enable/disable maintenance mode for a website please let me know.
I have now also tried:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://mckennastudios.com/maintenance.html [R=307,L]
with the same exact results
Have you tried
Redirect /index.html http://mckennastudios.com/maintenance.html
Alright it works, but is there any way for me to add an exception for specific ip addresses?
EDIT: Nevermind it's not working, so before I just re-uploaded my maintenance.html and the .htaccess and it worked. But after I added all of my files it still went to my index.php
I tried this line:
Redirect /index.php http://mckennastudios.com/maintenance.html
but it does not work. I also found another problem with this, if a user has a bookmark to another page on my site...then they will still be taken to that page. So this actually does not work for what I need, I just need somebody to help me get the script below to work in google chrome, because as I said it seemed to work in IE:
RewriteEngine on
RewriteBase /
RewriteCond %{REMOTE_ADDR} !^MY\.IP\.GOES\.HERE
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://mckennastudios.com/maintenance.html [R=307,L]
Sorry to bump in. But, a 301 redirect would've worked for you - but is very bad practice. You've clearly mentioned you're redirecting users to this page only for 'maintenance'. 301 is used for a 'permanent redirect' - meaning your search engine indexes will go for a toss. Read this: http://support.google.com/webmasters/bin/answer.py?hl=en&answer=93633
307 (temporary redirect) is the right way to do it as it tells the client to remember this redirect is only temporary and prompts the client to visit the requested URL the next time - meaning the 2nd time your user enters the 'root' or 'request URL' of your domain name, the client will not be redirected to /maintenance.html, but will look for /index.html or the originally requested URL.
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} !^/maintenance\.html$
RewriteRule ^(.*)$ http://mckennastudios.com/maintenance.html [R=307,L]
Your original code should work. Where in .htaccess did you put this code? Do you have other lines in .htaccess file? Maybe a possible conflict of rules?
-ST
Try this:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintanence.html$
RewriteRule $ /maintenance.html [R=307,L]
Also, instead of creating the file locally and pushing it to the server, do you have cPanel access or something to your server where you can create a new file, name it .htaccess and put all of this in it from your web-control panel and not via FTP?
So now with that option it's not working on any browser, I een used the cpanel to create the file. Also, I apologize for my delayed response. But instead of .htaccess is there any well known script I could use? Since the .htaccess seems to be providing a lot of problems.
North America
Europe, Middle East and Africa
Asia Pacific