Answer the question
In order to leave comments, you need to log in
How to remove .html from the end of url in WP?
Tried this one:
RewriteEngine On
RewriteCond %{REQUEST_URI} ! \.html$
RewriteCond %{REQUEST_URI} ! /$
RewriteRule ^(.*)$ $1.html
Answer the question
In order to leave comments, you need to log in
In .htaccess file write
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ DOMEN.COM/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
*Where your domain.com is
In the admin panel
Settings - Permalinks - Arbitrary (custom) permalinks,
select the structure and delete at the end of .html
for example,
/%category%/postname%/
or
/postname%/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question