Answers for "removing filepath from url using htaccess"

4

removing filepath from url using htaccess

#remove html file extension-e.g. https://example.com/file.html will become https://example.com/file
RewriteEngine on 
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f
RewriteRule ^(.*)$ $1.html [NC,L]
Posted by: Guest on June-13-2020
0

removing filepath from url using htaccess

#remove php file extension-e.g. https://example.com/file.php will become https://example.com/file 
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.*)$ $1.php [NC,L]
Posted by: Guest on September-24-2020

Code answers related to "removing filepath from url using htaccess"

Browse Popular Code Answers by Language