WordPress.org

Ready to get started?Download WordPress

Forums

WP Super Cache
[resolved] htaccess keeps changing, bloated, corrupt (6 posts)

  1. Joe Greenwood
    Member
    Posted 2 years ago #

    Hello again, one more question ... not sure if it's this plugin or something else, but my .htaccess file keeps changing and I have to reset it. Any ideas why it gets changed? It seems like what is happening is that the core WP settings are added to the end of the file repeatedly ... if let alone, the htaccess file will become very very large!

    # 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
    # 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
    # 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
    # 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

    For example :O) .... Worse, the WP Super Cache settings will be wiped out and I'm left with simply a huge file with the repeating WP settings as shown above.

    The reason I suspect this plugin is because the problem doesn't seem to happen when caching is turned off. But of course maybe there is something else that I do not yet see.

    Any insight is greatly appreciated. Thank you!
    Joe

    http://wordpress.org/extend/plugins/wp-super-cache/

  2. Joe Greenwood
    Member
    Posted 2 years ago #

    And then there are times when I get the following:
    "A difference between the rules in your .htaccess file and the plugin rewrite rules has been found. This could be simple whitespace differences but you should compare the rules in the file with those below as soon as possible. Click the ’Update Mod_Rewrite Rules’ button to update the rules."

    [EDIT -- I tried to cut/paste from the WP Super Cache Advanced Settings page but it was just a mess ... instead please see this screenshot: http://tinyurl.com/6v59mgr ...]

    I have no idea why that change would come along? I am now in the habit of checking the WP Super Cache 'Advanced Settings' page to see if my htaccess rules have changed ... and every time I check, sure enough they have changed. What in the world keeps changing them?

  3. Joe Greenwood
    Member
    Posted 2 years ago #

    Now, three hours later, my htaccess is totally corrupt. Here are its contents:

    [Code moderated as per the Forum Rules. Please use the pastebin]

    I don't know why this keeps happening. I am using mod_rewrite mode, maybe I'll have to switch. Too bad, I was getting to like the <2s page loads!

  4. Joe Greenwood
    Member
    Posted 2 years ago #

    I thought maybe another plugin might be making changes to the htaccess file .. so I searched my plugins for "insert_with_markers" ... but the only plugin doing such a thing is WP Super Cache:

    [~/public_html/wp-content/plugins]# grep -r -H "insert_with_markers" *
    wp-super-cache/wp-cache.php:            $gziprules = insert_with_markers( $cache_path . '.htaccess', 'supercache', explode( "\n", $gziprules ) );
    wp-super-cache/wp-cache.php:    if( insert_with_markers( $home_path.'.htaccess',htaccess', 'WordPress', explode( "\n", $wprules ) ) ) {
    wp-super-cache/wp-cache.php:    if ( $scrules != '' && insert_with_markers( $home_path.'.htaccess', 'WPSuperCache', array() ) ) {
    wp-super-cache/Changelog.txt:     Actually insert_with_markers instead of echoing the command!

    Maybe it's something with my server environment? I am on "Cloud Hosting" with VPS.NET .....

    Any clues anyone? Much appreciated for any suggestions. I am leaning toward PHP mode .... but would rather stick with mod_rewrite.

  5. Donncha O Caoimh
    Member
    Plugin Author

    Posted 2 years ago #

    I don't know why that's happening but PHP mode is 99% as fast as mod_rewrite for normal traffic so you're not really losing out unless Stephen Fry mentions your site in a tweet...

  6. Joe Greenwood
    Member
    Posted 2 years ago #

    Hahahahaaa .... I have to admit of being ignorant of the man's existence but looking him up I see I've been missing out -- looking forward to seeing him in The Hobbit!

    Okay so I figured out why my .htaccess kept getting 'corrupted' and indeed very bloated ... and it hasn't a thing to do with your plugin!

    Instead it's my own stinkin' "plugin-in-progress" currently operating in my functions.php ... where I set up custom taxonomy and use flush_rewrite_rules(); ... which with the default true setting gives a "hard" flush to htacess, followed I suppose by a rewrite of the standard WP commands ... so setting it to flush_rewrite_rules( false ); makes it a 'soft flush' according to WP Codex, leaving the htaccess alone, and this solves my problem .. uhh .. so apparently everytime functions.php was called .. pretty much every page view, no? .. that htaccess was getting writ to ....... no wonder it was 'corrupted and bloated'! wow

    Anyway thanks for listening, and double for the Stephen Fry tip

    JOE

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic