How to remove .html from website url?

How to remove the .html from the website url for example website.domain/file.html to website.domain/file?

You need to add these to .htaccess

Options +MultiViews
RewriteEngine on
RewriteCond %{THE_REQUEST} /([^.]+)\.html [NC]
RewriteRule ^ /%1 [NC,L,R]
RewriteCond %{REQUEST_FILENAME}.html -f
RewriteRule ^ %{REQUEST_URI}.html [NC,L]

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.