.htaccess Redirect Rules and Optimization

Hosting & cPanel · 26.02.2025
.htaccess Redirect Rules and Optimization

Force HTTPS and Caching

RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
💡 .htaccess only works on Apache. For Nginx, add equivalent rules to your server{} block.
← Back to Knowledge Base Ask Support