# =========================================================
# Future Mining Tools - .htaccess
# URL se .php extension hatane ke liye
#   about.php        ->  /about
#   fmt-160.php      ->  /fmt-160
#   index.php        ->  /
# Is file ko website ke root folder (public_html) me rakho.
# =========================================================

Options -MultiViews -Indexes
DirectoryIndex index.php

<IfModule mod_rewrite.c>
RewriteEngine On

# 1) /index.php  ->  /
RewriteCond %{THE_REQUEST} \s/+index\.php[\s?] [NC]
RewriteRule ^index\.php$ / [R=301,L]

# 2) /page.php  ->  /page   (purane .php links bhi clean URL par chale jayenge)
#    Query string (jaise ?product=FMT+160) apne aap bani rehti hai
RewriteCond %{THE_REQUEST} \s/+(.+?)\.php[\s?] [NC]
RewriteRule ^ /%1 [R=301,L]

# 3) /page  ->  page.php  (andar se file chalegi, URL clean rahegi)
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+?)/?$ $1.php [L]
</IfModule>
