S
S
Skrolea2016-10-17 17:56:44
linux
Skrolea, 2016-10-17 17:56:44

Is it possible to make such a redirect?

Good afternoon. The webmaster made a new website (redesign) on WordPress. Did you enable some plugin or is it a permanent setting (not familiar with WordPress) - permalinks "/%category%/%postname%.html". Those. all pages of the site are now with html. However, the old site has pages both without html at the end and with it. Is it possible to do in .htacess that "if a link is in a certain section without html, then redirect to the same address, but with html". Or is it unrealistic?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Andrey Burov, 2016-10-17
@BuriK666

possibly.

RewriteEngine On
RewriteCond %{REQUEST_URI} !^.*\.html$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ %{REQUEST_FILENAME}.html

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question