HEX
Server: LiteSpeed
System: Linux in-mum-web1831.main-hosting.eu 5.14.0-570.21.1.el9_6.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 11 07:22:35 EDT 2025 x86_64
User: u503286720 (503286720)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: /home/u503286720/domains/vistasadindia.com/public_html/.htaccessnew1
<IfModule mod_reqtimeout.c>
    RequestReadTimeout header=600,MinRate=500 body=600,MinRate=500
</IfModule>

RewriteOptions inherit
RewriteEngine On
RewriteBase /

# ✅ CUSTOM 404 PAGE
ErrorDocument 404 /404.php

# ✅ ALLOW REAL FILES & FOLDERS (VERY IMPORTANT FIX)
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]

# ✅ SAFE POST VIEW ROUTING (ONLY CLEAN SLUGS)
RewriteCond %{REQUEST_URI} !\.(jpg|jpeg|png|gif|webp|svg|avif|css|js|ico)$ [NC]
RewriteRule ^([a-zA-Z0-9-]+)/?$ post-view.php?id=$1 [QSA,L]

# ✅ FORCE UNKNOWN URL → 404 PAGE (FIX FOR YOUR ISSUE)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /404.php [L]

# ✅ REDIRECT WWW → NON-WWW
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]

# ✅ FORCE HTTPS
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^vistasadindia\.com$
RewriteRule ^(.*)$ https://vistasadindia.com/$1 [R=301,L]

# ✅ ENABLE GZIP
<IfModule mod_deflate.c>
    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript font/opentype font/otf font/ttf image/svg+xml image/x-icon
    BrowserMatch ^Mozilla/4 gzip-only-text/html
    BrowserMatch ^Mozilla/4\.0[678] no-gzip
    BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
    Header append Vary User-Agent
</IfModule>

# ✅ PHP VERSION
<IfModule mime_module>
    AddHandler application/x-httpd-ea-php73 .php .php7 .phtml
</IfModule>

# ✅ ALLOW IMAGES
<FilesMatch "\.(jpg|jpeg|png|gif|webp|svg|avif)$">
    Require all granted
</FilesMatch>

# ✅ PREVENT REWRITE FOR IMAGES
RewriteCond %{REQUEST_URI} \.(jpg|jpeg|png|gif|webp|svg|avif)$ [NC]
RewriteRule .* - [L]

# ✅ LITESPEED CACHE
<IfModule LiteSpeed>
    CacheLookup on

    RewriteCond %{REQUEST_URI} !^/path/to/exclude/
    RewriteRule .* - [E=Cache-Control:max-age=120]

    RewriteCond %{REQUEST_URI} ^/login$ [NC]
    RewriteRule .* - [E=Cache-Control:no-cache]

    ExpiresActive On
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType application/pdf "access plus 1 month"
    ExpiresByType text/x-javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 year"
    ExpiresDefault "access plus 2 days"

    AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</IfModule>

# ✅ BROTLI
<IfModule mod_brotli.c>
    AddOutputFilterByType BROTLI_COMPRESS text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
</IfModule>

# ✅ SECURITY HEADERS
<IfModule mod_headers.c>
    Header set X-Content-Type-Options "nosniff"
    Header set X-XSS-Protection "1; mode=block"
    Header set Strict-Transport-Security "max-age=31536000; includeSubDomains"
    Header always set Referrer-Policy "strict-origin-when-cross-origin"
</IfModule>

# ✅ CACHE CONTROL
<IfModule LiteSpeed>
    CombineCSS on
    CombineJS on

    RewriteCond %{QUERY_STRING} !=""
    RewriteRule .* - [E=Cache-Control:max-age=2592000]
</IfModule>

# ✅ FONT CACHE
ExpiresByType font/woff "access plus 1 year"
ExpiresByType font/woff2 "access plus 1 year"
ExpiresByType application/font-woff "access plus 1 year"
ExpiresByType application/font-woff2 "access plus 1 year"