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…
Combine HTTPS and WWW redirection rules
This doc brings two other docs together for those who need to implement both: Redirect HTTP to HTTPS and Fixing non-www redirection. In order to achieve this you have to add the following MU plugin. The plugin will add the…
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…
Redirection to enforce/remove trailing slash on URLs
WP Rocket will respect the trailing slash configuration you have for your site. However, this feature won't work in the following cases: WP Rocket rewrite rules are present in the .htaccess file. This is, when the mobile-specific cache (or the…
Remove expires (mod_expires) rules from .htaccess file
On some occasions, you may want to disable the expires rules WP Rocket is adding in the .htaccess file. You can prevent WP Rocket from adding those rules by installing the following helper plugin. 📥 Download (.zip): WP Rocket |…
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…