• I’m using the latest versions of WP and W3TC.

    I have rewrite rules in my .htaccess to make “tigercooke.com” become “www.tigercooke.com”.

    I’ve recently installed W3TC. The site is now working, but is still slow. I suspect the problem is this :

    /wp-content/w3tc-tigercooke.com/min/9349ce/default.include.1368345474.css
    is being rewritten as :
    /wp-content/w3tc-tigercooke.com/min/9349ce/www.tigercooke.com

    The problem replicates for a few other cached .js files too. The website loads eventually, but it’s not fast.

    Has anyone come across this conflict before?
    Or could anyone suggest a solution, either on a more specific .htaccess rule to avoid trying to rewrite the “w3tc-tigercooke.com”, or maybe a way to rename the “w3tc-tigercooke.com” folder name within the plugin?

    Any help would be greatly appreciated!

Viewing 10 replies - 1 through 10 (of 10 total)
  • what .htaccess rule are you currently using?

    Thread Starter tigertiger

    (@tigertiger)

    These are the ones I’m currently using :

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]

    # to redirect tigercooke.com to https://www.tigercooke.com
    RewriteCond %{HTTP_HOST} ^tigercooke\.com$ [NC]
    RewriteRule ^(.*)$ https://www.tigercooke.com/$1 [R,L]

    # to redirect tadhgcooke.com to https://www.tigercooke.com
    RewriteCond %{HTTP_HOST} ^tadhgcooke\.com$ [NC,OR]
    RewriteCond %{HTTP_HOST} ^www\.tadhgcooke\.com$ [NC]
    RewriteRule ^(.*)$ https://www.tigercooke.com/$1 [R,L]

    There are also some rules left over from WP Super Cache which I don’t understand yet :

    # uploaded files
    RewriteRule ^files/(.+) wp-includes/ms-files.php?file=$1 [L]

    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^ – [L]
    RewriteRule . /index.php [L]

    Your redirect of tigercooke to https://www.tigercooke is fine – it won’t do a redirect of xxx.tigercooke

    Its almost the same as the one I changed my redirect to to avoid problems with an additional redirect:

    #
    RewriteCond %{HTTP_HOST} ^roguegenecollective.com$ [NC]
    RewriteRule ^(.*)$ https://www.roguegenecollective.com/$1 [L,R=301]
    #

    Strictly speaking, yours is more correct, as the ‘.’ in mine rather than ‘\.’ in yours matches any character. I have R=301 rather than just R as I can never remember which redirect is the default (301 is ‘permanent’, I hope!)

    I don’t know what the extra rules you have are doing, sorry!

    Thread Starter tigertiger

    (@tigertiger)

    Thanks efikim.

    I think my problem is related to this, rather than the domain rewrite :
    /wp-content/w3tc-tigercooke.com/

    All I want to do is rewrite the domain, but I think when htaccess sees the /w3tc-tigercooke.com within the url it treats that in the same way as a domain, so I end up with https://www.tigercooke.com appended to the entire url.

    I’ve experimented with a few rules using the ! operator and trying to get an IF/ELSE thing going, but I seem to be either generating server errors, creating loops or just not making any change whatsoever. Arg.

    The RewriteCond rule you have is very specific:

    firstly the %{HTTP_HOST} means just look at the domain name
    then the ^ means ‘starts with’ and the $ means ‘end of string’ and you’ve specified exactly every character in between.
    so it should only fire for a url beginning with the domain name https://tigercooke.com/ (NC just means ignore case)
    (it shouldn’t look for any matches after the domain name – if it does, something else is broken!)

    Then the RewriteRule just says take everything that came after the domain name and stick it unchanged after the new domain name ‘https://www.tigercooke.com/’.

    This rule shouldn’t be looking beyond the domain name, so shouldn’t be the cause of what you’re seeing.

    PS – for short term testing to check this, you could just comment out that rule for a quick test.

    Thread Starter tigertiger

    (@tigertiger)

    Hmmm. That’s a puzzler then.

    Is it possible that W3TC is causing the loop error then?

    I don’t know, sorry.
    needs input from Frederick I think!

    Thread Starter tigertiger

    (@tigertiger)

    Okay… I’ve narrowed it down a little. When I look at the source code generated for the website, this code appears in the head :

    https://css.tigercooke.com/wp-content/w3tc-tigercooke.com/min/9349ce/default.include.1368345474.css

    But there’s no such file in that location. There IS a “default.include.css.id” file which contains just the number : 1368345474

    Then it’s rewritten as :

    https://css.tigercooke.com/wp-content/w3tc-tigercooke.com/min/9349ce/www.tigercooke.com

    There is a .htaccess file in the “min” folder with rewrite rules in it. Could that be a source of the problem?

    (There’s a similar error for the minified js file, but I figure if I sort the CSS problem out, it’ll fix the JS problem too.)

    Thread Starter tigertiger

    (@tigertiger)

    By (lengthy) process of elimination it’s just the minify module that’s causing problems for me. I can’t seem to debug it. If anyone knows of a solution to this, please let me know. Thanks!

    Everything else seems to be working fine – although the far-future expires still isn’t setting correctly for some files.

    Plugin Contributor Frederick Townes

    (@fredericktownes)

    The .htaccess file in the w3tc/min/ directory isn’t working on your server. Minify working has nothing to do with the response time from your server being high. If you paste the your entire .htaccess file here or better yet fill out a bug submission form from the support tab of the plugin.

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘[Plugin: W3 Total Cache] Redirect Loop – htaccess conflict?’ is closed to new replies.