# Land Coordinates Technology — Apache / cPanel config (clean URLs)
Options -Indexes -MultiViews
DirectoryIndex index.php
ErrorDocument 404 /404.php
AddDefaultCharset UTF-8

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /

# Force https://www. — uncomment once SSL is active on the domain
# RewriteCond %{HTTPS} off [OR]
# RewriteCond %{HTTP_HOST} !^www\. [NC]
# RewriteRule ^ https://www.lctss.in%{REQUEST_URI} [R=301,L]

# Block direct access to the PHP includes
RewriteRule ^includes(/|$) - [F,L]

# Strip index.php / index.html from any URL:  /about-us/index.php -> /about-us/
RewriteCond %{THE_REQUEST} \s/+((?:[^\s?]*/)?)index\.(?:php|html?)[\s?]
RewriteRule ^ /%1 [R=301,L,NE]

# Old static-site file names:  /404.html -> 404 page
RewriteRule ^404\.html$ - [R=404,L]

# Add a trailing slash to page folders:  /about-us -> /about-us/
RewriteCond %{REQUEST_FILENAME} -d
RewriteCond %{REQUEST_URI} !/$
RewriteRule ^(.*)$ /$1/ [R=301,L]
</IfModule>

<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType image/webp "access plus 1 year"
ExpiresByType image/svg+xml "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/javascript "access plus 1 month"
</IfModule>

<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE text/html text/css application/javascript image/svg+xml application/xml
</IfModule>
