mirror of
https://github.com/myronblair/epictravelexpeditions
synced 2026-07-27 16:32:33 -05:00
Harden .git/db block: use REQUEST_URI matching, direct RewriteRule patterns not reliably honored
This commit is contained in:
+4
-1
@@ -8,7 +8,10 @@
|
||||
# Block direct access to config.php / .env - this was reachable at
|
||||
# /api/config.php in production (200 OK) despite the FilesMatch/Require
|
||||
# rule below, which LiteSpeed appears not to honor from .htaccess here.
|
||||
RewriteRule ^(config\.php|\.env)$ - [F,L]
|
||||
# Matching on REQUEST_URI (not a direct RewriteRule pattern) is what's
|
||||
# confirmed to actually work on this LiteSpeed setup.
|
||||
RewriteCond %{REQUEST_URI} /(config\.php|\.env)$
|
||||
RewriteRule .* - [F,L]
|
||||
|
||||
# Route all requests to index.php
|
||||
RewriteCond %{REQUEST_FILENAME} !-f
|
||||
|
||||
Reference in New Issue
Block a user