W3TC Minify problem

Home Forums BulletProof Security Free W3TC Minify problem

Tagged: 

This topic contains 26 replies, has 4 voices, and was last updated by  AITpro Admin 4 years, 5 months ago.

Viewing 15 posts - 1 through 15 (of 27 total)
  • Author
    Posts
  • #6356

    Valeyard
    Participant

    Hi,

    I have been using w3tc to minify my css files. The minified css file has a path like /wp-content/cache/minify/000000/42376/default.include.98e853.css Recently BPS has been throwing 403 when accessing these files.

    Thanks,
    Edward

    #6357

    Valeyard
    Participant
    >>>>>>>>>>> 403 GET or Other Request Error Logged - May 25, 2013 - 6:41 pm <<<<<<<<<<<
    REMOTE_ADDR: 174.61.225.164
    Host Name: xxxxx.hsd1.wa.comcast.net
    HTTP_CLIENT_IP:
    HTTP_FORWARDED:
    HTTP_X_FORWARDED_FOR: xxxxx
    HTTP_X_CLUSTER_CLIENT_IP:
    REQUEST_METHOD: GET
    HTTP_REFERER: http: //tools.pingdom.com/fpt/
    REQUEST_URI: /wp-content/cache/minify/000000/42376/default.include.c479ce.css
    QUERY_STRING:
    HTTP_USER_AGENT: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.93 Safari/537.36
    #6360

    AITpro Admin
    Keymaster

    So where are you unning a Pingdom test on your website?  Are you seeing any other similar minify errors from other sources?  Why would this URI be accessed directly?  That seems very strange.

    #6361

    Valeyard
    Participant

    Yes, this also happens when I  try to access my website from my own computer. This URI is accessed because it is the combined css file used in my site?

    #6362

    Valeyard
    Participant

    Basically w3tc will combine all the css files used into one file and add something like this to the head

    <link rel="stylesheet" type="text/css" href="http://xxxxx/wp-content/cache/minify/000000/42376/default.include.98e853.css" media="all">
    #6363

    AITpro Admin
    Keymaster

    I avoid minifying like the plague (problems, more problems and then lots more problems) so I am no expert on all the problems that occur when minifying things.  Personally I do not recommend that you minify anything, but each to his/her own. No one has ever reported this before and I really have no logical idea why this is occurring.  You can add a RewriteEngine Off .htaccess file in the /wp-content/cache/minify/ folder so that BPS will no longer look at these files.  See the link below.
    http://forum.ait-pro.com/forums/topic/rewriteengine-off-htaccess-file/

    #6366

    Valeyard
    Participant

    Cool. My guess would be the wacky URI is triggering some rewrite rule for preventing attacks. For the RewriteEngine Off .htaccess, it also applies to all the subdirectories as well?

    #6367

    AITpro Admin
    Keymaster

    Uh minifying is whacky in itself.  LOL

    Yep, .htaccess files are recursive/hierarchical.  An .htaccess file in a parent folder will apply its rules to the child folders of that parent, unless the child folder has its own .htaccess file.
    Parent – /wp-content/cache/minify/.htaccess
    Child/subfolders – /000000/42376/

    #6368

    Valeyard
    Participant

    Thanks! It seems the rewrite off doesn’t work, as w3tc itself uses rewriteengine to link: http: //xxxxx/wp-content/cache/minify/000000/42376/default.include.98e853.css to something like http: //xxxxx/wp-content/plugin/w3tc/minify.php?file=default.include.98e853.css After some manual testing, it seems for some reason that I don’t understand

    RedirectMatch 403 /\..*$ is too general and changing it to
    RedirectMatch 403 ^/\..*$ solves the problem.

    Btw, I have some apache error msgs regarding /404.php not found (the theme’s 404 page does show up tho), I think a better way to do it is change: ErrorDocument 404 /404.php to ErrorDocument 404 /index.php?error=404 according to http://codex.wordpress.org/Creating_an_Error_404_Page#Help_Your_Server_Find_the_404_Page

    #6373

    AITpro Admin
    Keymaster

    Not sure why adding a caret would work for the RedirectMatch 403 code.  That code only matches files that start with a dot.  Example:  .htaccess, .htpasswd, etc. using index.php?error=404 ONLY works if you are not using a Custom Permalink Structure.

    #6396

    Valeyard
    Participant

    Ahh I see. Changed the 404 thing back. Thanks again for the help.

    #10295

    Arpan Das
    Participant

    Hi, I’m getting errors on each of my posts visited by users. Any idea how it is producing so I can fix it?
    Logs are below…

    >>>>>>>>>>> 403 GET or Other Request Error Logged - 2-October-2013 - 12:31 pm <<<<<<<<<<<
    REMOTE_ADDR: 223.255.225.35
    Host Name: subs09a-223-255-225-35.three.co.id
    SERVER_PROTOCOL: HTTP/1.1
    HTTP_CLIENT_IP:
    HTTP_FORWARDED:
    HTTP_X_FORWARDED_FOR:
    HTTP_X_CLUSTER_CLIENT_IP:
    REQUEST_METHOD: GET
    HTTP_REFERER: http: //w3epic.com/zebra-striping-effect-on-html-table-rows/
    REQUEST_URI: /wp-content/cache/minify/000000/ZY9JDoMwDEUvhHEr2hP0JAFMEpSpthHk9o06sOnC1vf7egtf0EUtnO9oZpnYF-1uOOUYKSkwlVD76FM34PrciOsZIHrLRundXnExaapjPmDJDHvmuTCJnPgr9b-7GZYUShaF4NvavTpQt8UxGR8EzWoOZ9IciG0JuzZhLyA1aePeutBGifGPDPj5QlDcIzO9AA.js
    QUERY_STRING:
    HTTP_USER_AGENT: Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53
    
    >>>>>>>>>>> 403 GET or Other Request Error Logged - 2-October-2013 - 12:31 pm <<<<<<<<<<<
    REMOTE_ADDR: 223.255.225.35
    Host Name: subs09a-223-255-225-35.three.co.id
    SERVER_PROTOCOL: HTTP/1.1
    HTTP_CLIENT_IP:
    HTTP_FORWARDED:
    HTTP_X_FORWARDED_FOR:
    HTTP_X_CLUSTER_CLIENT_IP:
    REQUEST_METHOD: GET
    HTTP_REFERER: http: //w3epic.com/zebra-striping-effect-on-html-table-rows/
    REQUEST_URI: /wp-content/cache/minify/000000/bYxLCoAwDAUvpATxBp7CbWlCU-2PpEV7e4tbXTwYZuAtcJVZe6rmZu84jFUS-JgV1IovVUF5k6a8xzAtcFAtxp4QM7ZAOs6cZM4_RdkIoUHsL_rkHg.js
    QUERY_STRING:
    HTTP_USER_AGENT: Mozilla/5.0 (iPad; CPU OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53
    #10307

    AITpro Admin
    Keymaster

    The most logical thing to try first would be a skip/bypass rule for the W3TC cache folder.

    1. Copy this code below to this BPS Custom Code text box:   
    2. Click the Save Root Custom Code button.
    3. Go to the BPS Security Modes page and click the Root Folder BulletProof Mode Activate button.
    Note: If your WordPress installation/website is in a folder named /MyWordPressFolderName/ then add your WordPress folder name in the path: example: RewriteCond %{REQUEST_URI} ^/MyWordPressFolderName/wp-content/cache/minify/ [NC]

    # W3TC Minify skip/bypass rule
    RewriteCond %{REQUEST_URI} ^/wp-content/cache/minify/ [NC]
    RewriteRule . - [S=13]

    If the code above does not work then try this next…

    # W3TC Minify skip/bypass rule
    RewriteCond %{REQUEST_URI} ^/wp-content/cache/minify/(.*)\.js [NC]
    RewriteRule . - [S=13]
    #10311

    Arpan Das
    Participant

    Hello… Why my post is deleted?

    Btw,
    I’m getting errors on each visitor visits a post. any idea how it is generating so i ca fix it?

    >>>>>>>>>>> 403 GET or Other Request Error Logged - 2-October-2013 - 12:04 pm <<<<<<<<<<<
    REMOTE_ADDR: 62.44.135.224
    Host Name: 0x3e2c87e0.mobile.telia.dk
    SERVER_PROTOCOL: HTTP/1.1
    HTTP_CLIENT_IP:
    HTTP_FORWARDED:
    HTTP_X_FORWARDED_FOR:
    HTTP_X_CLUSTER_CLIENT_IP:
    REQUEST_METHOD: GET
    HTTP_REFERER: http://w3epic.com/run-java-apps-j2me-on-android-devices-guide/
    REQUEST_URI: /wp-content/cache/minify/000000/bYtRDsIgEEQvVFyNeqAtbIEKLC7btNzeptF--TN5M5N3hZC1Cj8BXbMSqw4PsJwzFTVCNfVLjmW4w_xeSPoJJkcvqHS8N5iw2D7yZiYWs7K4KtTaOX-ly6_vhic1lZuaFPdYowajYcljwZga4IxbwOISia9p1V2YSSvaF2R2S6IGa_XCgf88LaCQQ-f6gbH4Dw.js
    QUERY_STRING:
    HTTP_USER_AGENT: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/534.24 (KHTML, like Gecko) Chrome/11.0.696.34 Safari/534.24
    #10313

    AITpro Admin
    Keymaster

    Your post was not deleted it was moved to this relevant topic for W3TC minify 403 errors.  Your post above will also be moved to this relevant Forum Topic for W3TC minify 403 errors.
    http://forum.ait-pro.com/forums/topic/w3tc-minify-problem/#post-10295

Viewing 15 posts - 1 through 15 (of 27 total)

You must be logged in to reply to this topic.