HTML5 Boilerplate.htaccess Caching Doesn't Work with WordPress

The .htaccess cache settings for the HTML5 Boilerplate ( http://html5boilerplate.com/ ) are awesome, but I ran into a problem with the busting cache for version control of JS and CSS.

 <IfModule mod_rewrite.c> RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.+)\.(\d+)\.(js|css|png|jpg|gif)$ $1.$3 [L] </IfModule> 

I cannot get this to work with WordPress rewrite settings already present in the .htaccess file.

 <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> 

In the best case, it will never be overwritten to my JS files. In the worst case, it crashes the site.

Anyone lucky this works with WordPress?

+7
source share
3 answers
  • Ensure that the cache intercept URLs match the rewrite pattern (script.0.js)
  • Set Caching Rewriting Rules Before WordPress
  • If you can access the server configuration and read the logs, install RewriteLog 2 (or higher), and then view the rewriting logs. They are hard to follow, but they can give you some clues.
  • "At worst, it crashes the site." If this means that you get 500 server errors, check the server logs - it will tell you if there is a rewrite cycle.

Change your WordPress rule to

 RewriteRule ^[\w/-]+$ /index.php [L] 

and see if that helps.

In the best case, I will never overwrite my JS files.

Do you see the answer "not found" WordPress or Apache?

In the worst case, it crashes the site.

Apache server error or WordPress error?

0
source

Can you make some php.ini settings embedded in your .htaccess and then test the website for changes, just check if the .htaccess file works or not?

In most cases, I came across the fact that there are several hidden files that are not supported by systems based on CentOS 5.5 (I don’t know if there was already a known error). But if you create a new file with the same name .htaccess, you will see several different lines than your original.

Just means that both are two different files. So just try to check which one works with your site. Also, to compress the JS and CSS files, I wrote a fairly detailed tutorial here http://www.codeandcommand.com/web-based/how-to-optimize-joomla-3-x-pagespeed.html

0
source

Try these

 <IfModule mod_expires.c> ExpiresActive off </IfModule> <IfModule mod_headers.c> Header unset Cache-Control </IfModule> 
0
source

All Articles