Home › Forums › BulletProof Security Free › Maintenance Mode in GWIOD website
Tagged: GWIOD, maintenance mode
- This topic has 3 replies, 2 voices, and was last updated 10 years, 8 months ago by M Childs.
-
AuthorPosts
-
M ChildsParticipant
Hello,
Is it intended that the maintenance mode feature should work on a GWIOD (Giving WP Its Own Directory) website?
When switched to maintenance mode the site is accessible for work from the htaccess configured IP address. But when I change to a different IP, instead of getting the default maintenance message I see a broken version of my website – looks like HTML without CSS rendering.I have the full BPS htaccess in my public_html/wordpress/ install directory, and a scaled down version of htaccess in the parent, public_html/. After playing with this for a few days I suspect that calls to mysite.com/index.php, which route to the htaccess and then index.php files in my public_html directory, are bypassing part of the BPS htaccess in the wordpress directory?
public_html/.htaccess file:
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress
public_html/index.php file:
<?php /** * Front to the WordPress application. This file doesn't do anything, but loads * wp-blog-header.php which does and tells WordPress to load the theme. * * @package WordPress */ /** * Tells WordPress to load the WordPress theme and output it. * * @var bool */ define('WP_USE_THEMES', true); /** Loads the WordPress Environment and Template */ require('./wordpress/wp-blog-header.php')
I have another sub-directory site running BPS just fine. But this GWIOD site is really stretching me. Any comments would be appreciated.
AITpro AdminKeymasterTo tell you the truth it has been so long since i messed with this on a GWIOD site I am not sure how this works. I just tested this and confirmed that I saw the same broken CSS. Maybe something has changed in WordPress since the last time I checked this. I’m pretty sure everything worked just like any other site type by clicking all maintenance mode buttons and activating maintenance mode. I will have to fiddle around with this on our GWIOD site and see why this is. will get back to you.
AITpro AdminKeymasterThere is some kind of internal rewriting that has changed with WordPress that no longer allows the maintenance .htaccess file to rewrite correctly for GWIOD sites. I believe it has something to do with Headers being loaded from the include files/templates.
And actually this is a very interesting thing in general. For a GWIOD site you would not even have to use a maintenance .htaccess file at all if this code was used in the root index.php file. I assume this approach would work for all other WordPress site types as well. We will look into changing the whole Maintenance Mode concept since this offers a simpler way to put a website into Maintenance Mode. I see a lot of benefits of using this approach over the current approach.
/** Loads the WordPress Environment and Template */ if ( $_SERVER['REMOTE_ADDR'] == '100.200.90.100' ) { require('./wordpress/wp-blog-header.php'); } else { require('./wordpress/bp-maintenance.php'); }
M ChildsParticipantAITpro Admin:
Thank you for your speedy response.It took me several hours to understand your conclusion but I think I’ve got it. Tested the modified index.php in my GWIOD site and also my sub-directory installed test site, and both worked as you predicted. Until the process is automated, I will manually change the root index.php when I need to put the site into maintenance mode.
Again, thank you for your assistance.
-
AuthorPosts
- You must be logged in to reply to this topic.