I have a page called “down for maintainance” or whatever you like and rename it as index.php via ftp when I want to shut down for a while. You have to rename the real index.php to something like index-real.php first.
This method isn’t very flexible though. Would be nice if one could have a template specificly made for “the website is offline” messages. A plugin could handle something like this I’m sure, and a tab in the Site Admin area could let you change the settings.
The plugin should let the administrator log in given that he has a certain permission level.
The reason to NOT get the theme system involved is that pulls in the entire WP codebase. You’d rather short-circuit with an index.htm file, so the WP site creates minimal load.
However, if you don’t have nice-URIs (or even if you do), realize that there are other files that could be direct-accessed, like wp-rss2.php. Not a big deal really.
If you want to really take it offline, best to move WP into a new subdirectory, protect it, THEN put just a index.htm in its place.
You know, here’s a good idea for a plugin that would solve this given that you don’t use custom URIs:
A plugin that is enabled can enable the administrator or other users with a given permission level to go to a certain Option-page. From here they get a check-box and a textarea where they can write a message to the users who want to get in.
When the checkbox is marked, a file called index.html will be created in the main directory. .html files will normally be loaded before .php files by default. This “placeholder”-file will include the message that the administrator wrote, and a link to the Site Administration page if the administrator allows this. Adding wp-admin/ to the URI will get you there anyway, but it makes it a little easier for the sub-administrators.
When the administrator then unchecks the “Take website offline” checkbox, the index.html is deleted and wolla – website is back online again.
The placeholder-file does not need to be linked to any templates at all if you include all the HTML in the plugin.
Any thoughts to this approach?
It’d work if the directory is writable, buts sounds like a lot of work to avoid making an index.html by hand 🙂
Well.. we’re talking about a flexible solution that doesn’t require you to have FTP access whenever you need to do something. The system administrator has turned off FTP connections in the firewall, so I’d have to log in through a PHP based FileManager which takes a lot of extra time.
I’m sure I could just make my own PHP script to do this, but a plugin that everyone could use would be even better.
- The topic ‘How To Take Blog Offline’ is closed to new replies.