# 1. PROTECT SENSITIVE FILES
# Prevents access to critical system files
Order Allow,Deny
Deny from all
# 2. PROTECT THE HTACCESS FILE
# Prevents unauthorized users from reading your .htaccess file
Order allow,deny
Deny from all
Satisfy all
# 3. BLOCK QUERY STRING EXPLOITS
# Stops common rewrite attacks and script injections
RewriteEngine On
RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
RewriteRule .* index.php [F,L]
# 4. CUSTOM FAVICON RULES
# Moved here to prevent WordPress from overwriting them
RewriteEngine On
RewriteRule ^apple-touch-icon\.png /wp-content/uploads/fbrfg/apple-touch-icon.png [QSA,L]
RewriteRule ^favicon-96x96\.png /wp-content/uploads/fbrfg/favicon-96x96.png [QSA,L]
RewriteRule ^favicon\.ico /wp-content/uploads/fbrfg/favicon.ico [QSA,L]
RewriteRule ^favicon\.svg /wp-content/uploads/fbrfg/favicon.svg [QSA,L]
RewriteRule ^site\.webmanifest /wp-content/uploads/fbrfg/site.webmanifest [QSA,L]
RewriteRule ^web-app-manifest-192x192\.png /wp-content/uploads/fbrfg/web-app-manifest-192x192.png [QSA,L]
RewriteRule ^web-app-manifest-512x512\.png /wp-content/uploads/fbrfg/web-app-manifest-512x512.png [QSA,L]
# 5. 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.
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]
# END WordPress
# 6. BEGIN Really Simple Security Disable directory indexing
Options -Indexes
# END Really Simple Security Disable directory indexing