WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[resolved] 301 Redirects Not Working With W3 Total Cache (8 posts)

  1. Sharunas
    Member
    Posted 2 years ago #

    Hello,

    My 301 redirects stopped working then installed W3 Total Cache, I also included all redirects to option "never cache these pages" under page cache, but that didn't help.

    I use Redirection plugin and it don't make any changes to .htaccess file.

    Any help would be appreciated.

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

  2. Sharunas
    Member
    Posted 2 years ago #

    Update:

    I found the half solution here: http://stackoverflow.com/questions/4814231/301-redirect-not-working-in-wordpress

    I placed this code to .htaccess file below w3 total cache rewrite rules:

    "<IfModule mod_rewrite.c>
    Options +FollowSymlinks
    RewriteEngine on

    ### non www to www
    RewriteCond %{HTTP_HOST} ^domain.com.au [NC]
    RewriteRule ^(.*)$ http://www.domain.com.au/$1 [R=301,L]

    ### re-direct index.html to root
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
    RewriteRule ^index\.html$ http://www.domain.com.au/ [R=301,L]

    redirect 301 /team.html http://www.domain.com.au/our-team/
    redirect 301 /contact.html http://www.domain.com.au/contact-us/

    # WrodPress rules begin here...
    </IfModule>"

    All 301 redirects seems working now and without any errors showing under W3 Total Cache settings, except one: the index.html still not redirecting to .com - all what I see is my hosts 404 error page :/

    and if I remove these lines from the code above:

    "### re-direct index.html to root
    RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
    RewriteRule ^index\.html$ http://www.domain.com.au/ [R=301,L]"

    W3 total cache throwing error:

    "It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration."

    Anybody?

  3. Sharunas
    Member
    Posted 2 years ago #

    +

    I tryed to add also:

    "Redirect 301 /index.html http://www.domain.com.au/
    Redirect 301 /Index.html http://www.domain.com.au/"

    but then again thse error under W3 total cache "It appears Page Cache URL rewriting is not working. If using apache, verify that the server configuration allows .htaccess or if using nginx verify all configuration files are included in the configuration."

    W3 Total Cache increased my page speed a lot and I want to continue using it, but these error killing all benefits :/

  4. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Have you tried adding the redirects before the rules added by W3TC? Cannot duplicate the issue you are having. Did the Page Cache message appear without rules as well?

  5. Frederick Townes
    Member
    Plugin Author

    Posted 2 years ago #

    Have you tried adding the redirects before the rules added by W3TC? Cannot duplicate the issue you are having. Did the Page Cache message appear without rules as well?

  6. Sharunas
    Member
    Posted 2 years ago #

    Yes, I added redirects before W3 Total Cache code, but that not helps because it works only until first cache cleaning.

  7. Frederick Townes
    Member
    Plugin Author

    Posted 1 year ago #

    Consider using preloading.

  8. Sharunas
    Member
    Posted 1 year ago #

    Thanks for your support.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic