If you want to remove .html extension, then simply add the given below snippet in your .htaccess file

RewriteEngine on
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html  [NC,L]

So now you can link .html page without extension on your web page. But when user will try to access with .html it will not redirect to without extension page.

So to make redirection you have to add some more code in your .htaccess file.
So the Complete .htacess code will be

RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]

RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^(.*)$ $1.html  [NC,L]

Leave a Reply

Your email address will not be published. Required fields are marked *

This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

The reCAPTCHA verification period has expired. Please reload the page.