Home › Forums › BulletProof Security Free › W3TC Minify problem
Tagged: W3TC Minify
- This topic has 26 replies, 4 voices, and was last updated 9 years, 6 months ago by
AITpro Admin.
-
AuthorPosts
-
Valeyard
ParticipantHi,
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,
EdwardValeyard
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
AITpro Admin
KeymasterSo 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.
Valeyard
ParticipantYes, 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?
Valeyard
ParticipantBasically 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">
AITpro Admin
KeymasterI 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/Valeyard
ParticipantCool. 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?
AITpro Admin
KeymasterUh 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/Valeyard
ParticipantThanks! 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 likehttp: //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 understandRedirectMatch 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
toErrorDocument 404 /index.php?error=404
according to http://codex.wordpress.org/Creating_an_Error_404_Page#Help_Your_Server_Find_the_404_PageAITpro Admin
KeymasterNot 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.
Valeyard
ParticipantAhh I see. Changed the 404 thing back. Thanks again for the help.
Arpan Das
ParticipantHi, 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
AITpro Admin
KeymasterThe 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]
Arpan Das
ParticipantHello… 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
AITpro Admin
KeymasterYour 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 -
AuthorPosts
- You must be logged in to reply to this topic.