RewriteEngine On # Redirect HTTP to HTTPS (production) # RewriteCond %{HTTPS} off # RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # If file or directory exists, serve directly RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d # Route everything through index.php RewriteRule ^(.*)$ index.php [QSA,L]