Remove File Extensions on Webpages?

cPanelLauren

Product Owner
Staff member
Nov 14, 2017
13,296
1,266
313
Houston
You can do this using a rewrite rule similar to:

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.htm [NC,L]
or

Code:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.htm$ /$1 [L,R=301]