Welcome to WebmasterWorld Guest from 54.196.244.45

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Temp maintenance page but allow developer access

View front end while in maintenance mode

     
3:06 pm on Aug 30, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 11, 2007
posts: 45
votes: 0


I need to be able to temporarily put a website in maintenance mode, showing a maintenance 'splash' page to the general public ... but I still need to be able to make changes to the website and be able to view the changes on the front end.

So I need to still view the front end of the site while it's down for maintenance.

How exactly can I do this?

Are there any commercial software available that will do this?

Thank you,
Ron
4:01 pm on Aug 30, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Send "503 Unavailable" status for all requests other than your own.

You'll need two lines of code in your htaccess file and a couple of lines of PHP code in a .php file.
4:09 pm on Aug 30, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 11, 2007
posts: 45
votes: 0


Thank you! That's a great start.

How do I send the 503 Unavailable to all requests but my own?

Can you provide the lines of code for the htaccess and the php? I'm completely new at this.

Thank you!
Ron
4:46 pm on Aug 30, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 11, 2007
posts: 45
votes: 0


I did a search and found instructions.

Thanks again,
Ron
4:56 pm on Aug 30, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


Let's see what you've tried...
6:03 pm on Aug 30, 2012 (gmt 0)

Junior Member

5+ Year Member

joined:June 11, 2007
posts: 45
votes: 0


Actually .... can I use an HTML page to show a styled maintenance message instead of the php file? Or does it have to be a php file?
8:05 pm on Aug 30, 2012 (gmt 0)

Senior Member

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month

joined:July 3, 2002
posts:18903
votes: 0


You can send a normal looking HTML page from within a .php file. It's even possible to configure a server to look for PHP code inside .html files.

You need the PHP functionality in order to be able to use the PHP HEADER directive to send the 503 status code.
9:45 pm on Aug 30, 2012 (gmt 0)

Senior Member from US 

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month

joined:Apr 9, 2011
posts:12704
votes: 244


Your maintenance message can simply be set up as a custom 503 ErrorDocument. All requests except the ones from your own IP-- or your own browser, or whatever is appropriate for your case-- get a 503 response. Make sure to leave a loophole to let the error document itself get served ;) I make it one RewriteRule with two Conditions.