Fix .git block: RedirectMatch/FilesMatch are not honored on this LiteSpeed vhost, use mod_rewrite instead

This commit is contained in:
2026-07-04 15:56:50 -05:00
parent 8ad58278d0
commit ea58754e62
+6 -5
View File
@@ -2,8 +2,9 @@
# The .git folder lives inside public_html (docRoot) and was found to be
# directly downloadable over HTTPS (e.g. https://orbis.orbishosting.com/.git/config),
# which leaked a live GitHub personal access token embedded in the remote URL.
RedirectMatch 404 /\.git
<FilesMatch "^\.">
Require all denied
</FilesMatch>
# Note: standard Apache access-control directives (RedirectMatch, FilesMatch/
# Require all denied, Order/Deny) are silently ignored on this LiteSpeed vhost.
# Only mod_rewrite rules are honored (confirmed via testing), hence this form.
RewriteEngine On
RewriteCond %{REQUEST_URI} ^/\.git
RewriteRule .* - [F,L]