Last active
December 27, 2020 15:17
-
-
Save robi052/89d80c746369a94541f35ff07ea07df1 to your computer and use it in GitHub Desktop.
htaccess tips and tricks what I'm using
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#forward http to https and non-www to www with only 1 hop | |
#hop test https://varvy.com/tools/redirects/ | |
<IfModule mod_rewrite.c> | |
RewriteEngine On | |
RewriteCond %{HTTPS} !=on | |
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L] | |
</IfModule> | |
#Block Wordpress authors scan | |
<IfModule mod_rewrite.c> | |
RewriteCond %{QUERY_STRING} (author=\d+) [NC] | |
RewriteRule .* - [F] | |
</IfModule> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment