Technical Configurations

9 results

Technical guides, info, and code examples.

Adding custom rules to the htaccess file

When you change or save WP Rocket's settings, the htaccess file is regenerated. WP Rocket always places its rules at the very top of the file, so if you had any custom rules there, they will get pushed down, below…

Disable use of the htaccess file by WP Rocket

In some server environments you may not have permissions to modify the htaccess file. To prevent unnecessary warnings, or for any other compatibility reason, you can prevent WP Rocket from trying to update the htaccess at all by installing the…

Fixing non-www redirection

Not having the correct redirects in place for the various versions of your domain can cause problems. There are a few ways to set up these redirects. ⚠️  After implementing any of the following solutions remove old configuration and cache…

Redirect HTTP to HTTPS

If you have SSL enabled for your entire site, you will need to make sure that all links pointing to the HTTP version of your site will be automatically redirected to the HTTPS version. You may use one of the…

When does WP Rocket write to the .htaccess file?

WP Rocket writes to the  .htaccess file in the scenarios listed below. Enabling or disabling plugin features: Mobile Cache WebP Compatibility CDN / RocketCDN Also, adding values to these features: Never Cache URLs Never Cache Cookies Never Cache User Agents Enabling or disabling…

WP Rocket rules in the .htaccess file

Upon activation, WP Rocket will automatically add some rules to the .htaccess file. The different blocks and rules are WP Rocket's instructions to apply browser caching, GZIP compression, redirect the requests to the cached pages, and others. These rules work on Apache…