WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
htaccess file overwrites my settings (6 posts)

  1. Rutger Groot
    Member
    Posted 3 years ago #

    Hi,

    I have a custom Rewrite in my htaccess which redirects my nonwww visitors to the www version of my site. This only works when '# BEGIN WordPress' is on top of the .htaccess file. When it's not, visitors get redirected to: http://www.sitename.com/wp-content/w3tc/pgcache/_index.html.gzip.

    I have manually placed the '# BEGIN WordPress' part on top of file and that works great but every time I edit some w3 total cache settings, the '# BEGIN W3TC Browser Cache' is placed back on top of my .htaccess file and i can start all over.

    Do you have a solution for this? Can you automatically place the W3TC Browser Cache after the '# END WordPress' part instead of before?

    Thanks in advance.

    Version: 0.9.1.3

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Rutger Groot
    Member
    Posted 3 years ago #

  3. DanMichel
    Member
    Posted 3 years ago #

    THANK YOU! im surprised people arent going nuts about this!

  4. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    This only works when '# BEGIN WordPress' is on top of the .htaccess file.

    I've never heard of a case like this working before. Can you paste your rules?

  5. Rutger Groot
    Member
    Posted 3 years ago #

    I use these custom rules:

    # 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]
    RewriteCond %{HTTP_HOST} ^zvoort.nl
    RewriteRule (.*) http://www.zvoort.nl/$1 [R=301,L]
    </IfModule>
    # END WordPress

    See my screencast: http://screencast.com/t/MVbxELFobr1d

  6. Frederick Townes
    Member
    Plugin Author

    Posted 3 years ago #

    RewriteCond %{HTTP_HOST} ^zvoort.nl
    RewriteRule (.*) http://www.zvoort.nl/$1 [R=301,L]

    Having these two directives at the top of your .htaccess file is ideal.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic