Sign in to follow this  
Followers 0
Anyue

Редирект, как будет правильно?

2 posts in this topic

Здравствуйте, есть вопрос. Есть сайт на https. Нужно сделать редирект на без www. То есть на https://site.ru, как будет правильно сделать?

Share this post


Link to post
Share on other sites

Этого достаточно:

RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule .* https://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]

 

 

 

p.s

Запас:

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

 

Anyue likes this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0

  • Recently Browsing   0 members

    No registered users viewing this page.