Forum Topic: Example of site maintenance

Forum: .htaccess Forum : Basics • Posted by Gregory Ledger • Updated:

Sorry if this is a really basic question.

Say I want to use the site maintenance temporary file and I'm working on a local host in MAMP. What would I replace the string after {REMOTE_ADDR} with?

!^123\.456\.789

And how is the "We'll be right back" page generated? That is in my download I don't see a .html or .php file with that text, so where is it coming from?

And finally, how can I see what my site is going to look like if it is in maintenance mode -- wouldn't I get the same message?

1 Reply to “Example of site maintenance”

Jeff Starr
Posted by Jeff Starr

These are great questions.

1) "Say I want to use the site maintenance temporary file and I’m working on a local host in MAMP. What would I replace the string after {REMOTE_ADDR} with?"

Localhost generally is 127.0.0.1, but note that if you are developing on a local server then maintenance mode is not necessary because the server should be inaccessible via the Web.

2) "And how is the “We’ll be right back” page generated? That is in my download I don’t see a .html or .php file with that text, so where is it coming from?"

That is something that Apache generates on its own. The book should provide alternate techniques for the case where you want to generate your own custom response page and/or message.

3) "And finally, how can I see what my site is going to look like if it is in maintenance mode–wouldn’t I get the same message?"

In general, unless you specifically allow your IP, you will see the response message that everyone else gets. That is, the only IPs that will not see the response are those that have been specifically allowed.

That said, for sites that are accessible via the Web, you can test to see if maintenance mode is working by visiting them via proxy server. The book should mention this, let me know if not so I can add the infos.