Skip to content

My recommended .htaccess settings for WordPress in a production environment.

License

Notifications You must be signed in to change notification settings

wataruesaki/wp-dot-htaccess

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

wp-dot-htaccess

My recommended .htaccess settings for WordPress in a production environment.

# Always use SSL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
</IfModule>

# Deny all access to this location
<Files ~ "^\.(htaccess|htpasswd)$">
deny from all
</Files>

# Hide a directory list
Options -Indexes

# Protect config and cron
<FilesMatch "^(wp-config\.php|wp-cron\.php)">
order allow,deny
deny from all
</FilesMatch>

About

My recommended .htaccess settings for WordPress in a production environment.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published