Answer the question
In order to leave comments, you need to log in
301 redirect from pages with html to without html co /?
Good afternoon.
A new website is being launched and the structure is changing.
Registered 301 redirects of the form
Redirect 301 /kontakty/ http: //site.ru/company/contacts/- that's how it works
Redirect 301 /catalog/product1.html http: //site.ru/catalog/product1/- so no - goes to the view page
http://site.ru/catalog/product1/product1.html - that is, it always does the redirect as it should, but adds .html
Answer the question
In order to leave comments, you need to log in
RewriteEngine on
RewriteBase /
RewriteCond %{THE_REQUEST} ^[AZ]{3,9}\ /([^.]+)\.html\ HTTP
RewriteRule ^([^.]+)\.html$ site.ru/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f
RewriteRule (.*) /$1.html
site Replace .ru with the domain of your site.
In .htaccess. Accessing /about.html redirects to /about. I myself use this option, and I advise you.
This method only removes the html tail, and I need a link to a different page in principle .
type
Redirect 301 site.ru/catalog/whitecat.html to site. ru/commodity/blackdog/
I signed everything in detail here, and brought it to the standard
https://klondike-studio.ru/standards/standartnyy-h...
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question