• jmarcello

    (@jmarcello)


    Greetings:

    Been running into this issue for a while now, but it seems that WP Supercache is constantly overwriting my .htaccess file which is a bad thing because we have a lot of important customization in there including a fairly extensive set of 301 redirects.

    Unfortunately, I often need to turn the plugin off and on temporarily to make changes to the site. Toggling it like this causes the .htaccess to be over written.

    Any help is greatly appreciated. Thanks in advance.

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • Sa?a

    (@stodorovic)

    Hello @jmarcello,

    I’ve installed WPSC on many websites together with custom rules into .htaccess. As I know, WP and WPSC don’t touch .htaccess outside their section.

    I recommend you to create separate section for your rules. My .htaccess has this structure:

    ## BEGIN - My Custom Redirects
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^.....$ ..... [R=301,L]
    .....
    </IfModule>
    ## END - My Custom Redirects
    
    # BEGIN WPSuperCache
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    .....
    </IfModule>
    
    # END WPSuperCache
    
    # 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
    

    Don’t put anything into WPSUperCache or WordPress section (it’s big chance to WP overwrites rules on “flush rules”, deactivate/activate cache plugins). Your rules should have higher priority (in almost all cases) and it’s reason why I added them to the beginning of .htaccess.

    I’ll try to help you (and check on my test server) if you send me more details.

    Regards,
    Sasa

    • This reply was modified 7 years ago by Sa?a.
Viewing 1 replies (of 1 total)
  • The topic ‘.htaccess file is being over written’ is closed to new replies.