Skip to content

Instantly share code, notes, and snippets.

@taricco
Last active March 10, 2021 23:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save taricco/cfbf4c172e434942261e00fcce9150b9 to your computer and use it in GitHub Desktop.
Save taricco/cfbf4c172e434942261e00fcce9150b9 to your computer and use it in GitHub Desktop.
# ----------------------------------------------------
# | HTACCESS for WordPress on NameHero |
# | Version: 03.10.21 |
# ----------------------------------------------------
# BEGIN Force SSL
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
Header always set Content-Security-Policy "upgrade-insecure-requests;"
</IfModule>
# END Force SSL
# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# Protect wp-config.php
<Files wp-config.php>
order allow,deny
deny from all
</Files>
# Protect xmlrpc.php
<Files xmlrpc.php>
order allow,deny
deny from all
</Files>
# END WordPress
php_value memory_limit 512M
php_value upload_max_filesize 64M
php_value post_max_size 64M
php_value max_execution_time 300
php_value max_input_time 259200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment