Created
October 21, 2021 19:15
-
-
Save justingivens/00d6073fa2edf379f1b3c7ec1c6af87b to your computer and use it in GitHub Desktop.
cpanel - lsws - geoip - wp standard htaccess with country code blocking
This file contains hidden or 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
<IfModule mod_geoip.c> | |
<FilesMatch "wp-login.php|xmlrpc.php"> | |
RewriteEngine On | |
#RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(US)$ # If using MOD_GEOIP with Litespeed Web Server | |
#RewriteCond %{HTTP:CF-IPCOUNTRY} !^(US)$ # If using CloudFlare | |
RewriteRule ^(.*)$ - [F,L] | |
</FilesMatch> | |
</IfModule> | |
# 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 | |
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] | |
RewriteBase / | |
RewriteRule ^index\.php$ - [L] | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d | |
RewriteRule . /index.php [L] | |
</IfModule> | |
# END WordPress | |
# php -- BEGIN cPanel-generated handler, do not edit | |
# Set the “ea-php74” package as the default “PHP” programming language. | |
<IfModule mime_module> | |
AddHandler application/x-httpd-ea-php74 .php .php7 .phtml | |
</IfModule> | |
# php -- END cPanel-generated handler, do not edit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment