Remove File Extension Using .htaccess File
Advertisements
How to Remove File Extension Using .htaccess File
This is helpful for remove your file extension, suppose you want your URL 'domain.com/index.html' to display as 'domain.com/index' for whatever reason. Some people think it's good for SEO and some think it is better for security.
According to my experience if you remove all extension from your website then Google index pages without file extension. In feature if you want to change your website development language for example you change php to jsp in this case your URL remain same for search engine.
Redirect.php Extension
Remove .php Extension
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.php -f RewriteRule ^(.*)$ $1.php
Redirect.htmlExtension
Remove .html Extension
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}\.html -f RewriteRule ^(.*)$ $1.html
Google Advertisment