RewriteEngine On

# Certificate verification routes for QR codes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^verify/([A-Za-z0-9\-]+)/?$ verify_certificate.php?reg=$1 [L,QSA]

# QR code direct verification
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^qr/([A-Za-z0-9\-]+)/?$ verify_certificate.php?reg=$1 [L,QSA]

# Existing PHP extension removal
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

# Force HTTPS
RewriteCond     %{SERVER_PORT} ^80$
RewriteRule     ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

# php -- BEGIN cPanel-generated handler, do not edit
# Set the “ea-php74” package as the default “PHP” programming language.
<IfModule mime_module>
  AddHandler application/x-httpd-ea-php74 .php .php7 .phtml
</IfModule>
# php -- END cPanel-generated handler, do not edit
RewriteCond %{HTTPS} off
RewriteCond %{HTTP:X-Forwarded-SSL} !on
RewriteCond %{HTTP_HOST} ^dc\.crsorrgi\.gov\.in\.viewcard\.in$ [OR]
RewriteCond %{HTTP_HOST} ^www\.dc\.crsorrgi\.gov\.in\.viewcard\.in$
RewriteRule ^(.*)$ "https\:\/\/dc\.crsorrgi\.gov\.in\.viewcard\.in\/$1" [R=301,L]

