1#remove html file extension-e.g. https://example.com/file.html will become https://example.com/file
2RewriteEngine on
3RewriteCond %{REQUEST_FILENAME} !-d
4RewriteCond %{REQUEST_FILENAME}\.html -f
5RewriteRule ^(.*)$ $1.html [NC,L]
1//put this piece of code in the root file .htaccess
2RewriteEngine on
3#remove extension html
4RewriteCond %{REQUEST_FILENAME} !-d
5RewriteCond %{REQUEST_FILENAME}\.html -f
6RewriteRule ^(.*)$ $1.html [NC,L]
7
8#remove extension php
9RewriteCond %{REQUEST_FILENAME} !-d
10RewriteCond %{REQUEST_FILENAME}\.php -f
11RewriteRule ^(.*)$ $1.php
1RewriteEngine On
2RewriteCond %{REQUEST_FILENAME} !-f
3RewriteRule ^([^\.]+)$ $1.php [NC,L]
4
1RewriteCond %{REQUEST_FILENAME}.php -f
2RewriteRule !.*\.php$ %{REQUEST_FILENAME}.php [QSA,L]
3