Skip navigation
Currently Being Moderated

Maintenance Mode

Feb 19, 2013 5:40 PM

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.

 
Replies
  • Currently Being Moderated
    Feb 19, 2013 6:40 PM   in reply to Gabriel McKenna

    Have you tried

    Redirect /index.html http://mckennastudios.com/maintenance.html

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 19, 2013 7:03 PM   in reply to Gabriel McKenna

    If it is only the redirection that you are worried about at this stage, the above will be the only line.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2013 12:47 PM   in reply to Gabriel McKenna

    Try this:

     

     

    RewriteEngine On
    RewriteRule ^(.*)$ http://mckennastudios.com/maintenance.html [R=301]
    

     

     

    Nancy O.

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 23, 2013 12:56 PM   in reply to Gabriel McKenna

    Did you restart Apache? When you edit your .htaccess file, sometimes you have to restart web services to make it "stick." Same with php.ini.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Feb 24, 2013 9:56 PM   in reply to Gabriel McKenna

    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

     
    |
    Mark as:
  • Currently Being Moderated
    Feb 25, 2013 8:40 AM   in reply to Sudarshan Thiagarajan

    I used a 301 to force the move thinking they're might be other .htaccess files on your server that were creating a conflict.  Check with your host.  But Sudarshan is correct.  307 is a better choice if you can get it to work. 

     

     

    Nancy O.

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Feb 25, 2013 8:00 PM   in reply to Gabriel McKenna

    In the 1 .htaccess file you have, do you have any other rules? Can you copy & paste them here?

     

    I'm assuming this .htaccess is in the webroot folder (public_html / www)?

     
    |
    Mark as:
  • Sudarshan Thiagarajan
    4,000 posts
    Oct 15, 2010
    Currently Being Moderated
    Feb 26, 2013 9:47 PM   in reply to Gabriel McKenna

    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?

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points