# Production security rules
Options -Indexes

<FilesMatch "^(\.env|\.env\..*|.*\.(bak|backup|old|orig|save|sql|sqlite|log|ini|conf|config))$">
    Require all denied
</FilesMatch>

<FilesMatch "^(composer\.(json|lock)|package(-lock)?\.json)$">
    Require all denied
</FilesMatch>

# Never expose source/config or server-side logs.
<FilesMatch "^(security_bootstrap\.php|config\.php|database\.php)$">
    Require all denied
</FilesMatch>

# Legacy developer/debug endpoints should never be reachable.
<FilesMatch "^(install|setup_manager|debug.*|test.*)\.php$">
    Require all denied
</FilesMatch>

# Block common sensitive directories/files.
RedirectMatch 403 ^/(config|logs|storage|backups)(/|$)
RedirectMatch 403 /(^|/)(error_log|\.git|\.svn)(/|$)

# Security headers are also emitted by security_bootstrap.php for PHP responses.
<IfModule mod_headers.c>
    Header always set X-Content-Type-Options "nosniff"
    Header always set X-Frame-Options "SAMEORIGIN"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
    Header always set Permissions-Policy "camera=(), microphone=(), geolocation=()"
</IfModule>

# Redirect HTTP to HTTPS when SSL is available.
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTPS} !=on
    RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
</IfModule>

# PHP 8.4 (cPanel)
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php84 .php .php8 .phtml
</IfModule>

RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http://deeptubewell.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://deeptubewell.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://shop.mannangoup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://shop.mannangoup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://shop.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://shop.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.deeptubewell.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.deeptubewell.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.shop.mannangoup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.shop.mannangoup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.shop.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^http://www.shop.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://deeptubewell.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://deeptubewell.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://shop.mannangoup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://shop.mannangoup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://shop.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://shop.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.deeptubewell.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.deeptubewell.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.mannangroup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.shop.mannangoup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.shop.mannangoup.top$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.shop.mannangroup.top/.*$      [NC]
RewriteCond %{HTTP_REFERER} !^https://www.shop.mannangroup.top$      [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php84” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php84 .php .php8 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
