Getting rid of .html extension in URL

chroneas

Member
Jun 10, 2019
5
0
1
Estonia
cPanel Access Level
Website Owner
Hi,

I tried to remove .html file extension from URL bar while usine .htaccess but I led to error 500.

The code I tried in .htaccess file:
Code:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.html -f 
RewriteRule ^(.*)$ $1.html [NC,L]
How can I get rid of .html file extension in url bar?

Thanks!
 

chroneas

Member
Jun 10, 2019
5
0
1
Estonia
cPanel Access Level
Website Owner
thanks, both solutions seemed to work but they both made the loading from one url to another really slow, I also have a few 301 redirects but they don't seem to intervene with given codes.

How could I solve this long loading time issue?
 

cPanelLauren

Product Owner II
Staff member
Nov 14, 2017
13,266
1,300
363
Houston
As far as I am aware none of those rewrite rules should have caused slow loading times. If you don't have access to WHM (which as a website owner I assume you do not) you can check cPanel>>Metrics>>Errors to see the last 300 error log messages relating to your account's domains which might be helpful for you. Otherwise I'd suggest working with your hosting provider to identify the cause of the delay.