avatarworf
Member
Posted 1 year ago #
W3TC v0.8.5.2
Hello, I have a strange redirection occuring when I request http://www.domain.com instead of domain.com.
http://www.domain.com gives a redirection to "http://domain.com/wp-content/w3tc/pgcache/_default_.html
I do have a rewrite entry in my root .htaccess file as follows
RewriteCond %{HTTP_HOST} ^www\.domain\.com
RewriteRule ^(.*)$ http://domain.com/$1 [R=301,L]
Could this be causing the problem?
Cheers,
--Andrew
Without knowing the rest of your configuration, its likely that if an attempt was made to load "http://www.domain.com/wp-content/w3tc/pgcache/_default_.html" then yes, the rewrite rule would cause that redirect
(I have the inverse rule, but broader - switching *.domain.com to http://www.domain.com - and that caused me similar issues)
avatarworf
Member
Posted 1 year ago #
Sorry the attempt to load a page was to http://www.domain.com/ - it must be w3tc which redirects to the cache page
no, if w3tc tries to load the cache page from www.* then that will be caught by the .htaccess rule and redirected.
What puzzles me is why w3tc would see the http://www.domain.com address in the first place - my understanding of .htaccess rules (admittedly shaky!) would mean that w3tc wouldn't see the request as being for http://www.domain.com but for http://domain.com
avatarworf
Member
Posted 1 year ago #
Thanks, Figured it out... the root .htaccess needed to have my WWW / non-WWW directive first before the list of W3 Total Cache
Right, that's no longer a problem in the development release.