Skip to content

Instantly share code, notes, and snippets.

@ruman
Created September 7, 2022 20:54
Show Gist options
  • Save ruman/ebf40f5c1574224c5679a89784689fba to your computer and use it in GitHub Desktop.
Save ruman/ebf40f5c1574224c5679a89784689fba to your computer and use it in GitHub Desktop.
Basic .htaccess file for Wordpress
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule "^(.*/)?\.git/" - [F,L]
RedirectMatch 404 /\.git
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
<Files xmlrpc.php>
order deny,allow
deny from all
</Files>
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment