A
A
Alexander Punchenko2019-04-15 16:15:53
htaccess
Alexander Punchenko, 2019-04-15 16:15:53

How to make a redirect from a link without .html to a link with .html without affecting the categories?

Tell me how to make redirects to a link ending in .html, but so that the categories remain /category/ ?
I found this rule
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^.]+)$ /$1.html [R=301,L]
But it adds .html to categories as well

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question