Skip to content

Instantly share code, notes, and snippets.

@kowsar89
Created August 10, 2017 06:01
Show Gist options
  • Save kowsar89/488fcfdcbeda9cef3c10dcf2bcd66521 to your computer and use it in GitHub Desktop.
Save kowsar89/488fcfdcbeda9cef3c10dcf2bcd66521 to your computer and use it in GitHub Desktop.
Htaccess for WP site
# Redirect WordPress xmlrpc.php requests
RewriteRule ^xmlrpc\.php$ "http\:\/\/0\.0\.0\.0\/" [R=301,L]
# BEGIN HTTPS
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>
# END HTTPS
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment