K
K
Kaz522018-01-28 21:52:00
HTML
Kaz52, 2018-01-28 21:52:00

301 redirect how to do?

Made a redirect from www. to without www, then redirect from index.html to /

RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.мойсайт.com$ [NC]
RewriteRule ^(.*)$ http://мойсайт.com/ [R=301,L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.html\ HTTP/
RewriteRule ^index\.html$ http://мойсайт.com/ [R=301,L]

Can you suggest how to redirect from / to without a slash or vice versa.
or maybe some other way. host on ispmanager site without cms
UPD. I made such a redirect, but it does not remove the slash from mysite.com/ to mysite.com
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} ^(.+)/$
RewriteRule ^(.+)/$ http://мойсайт.ком/$1 [R=301,L]

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
mrWan, 2018-01-29
@Kaz52

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} (.*)
RewriteCond %{REQUEST_URI} /$ [NC]
RewriteRule ^(.*)(/)$ $1 [L,R=301]

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question