RewriteEngine on # block files and folders beginning with a dot, such as .git # except for the .well-known folder, which is used for Let's Encrypt and security.txt RewriteRule (^|/)\.(?!well-known\/) index.php [L] # make site links work RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*) index.php [L]