Answer the question
In order to leave comments, you need to log in
Is the 301 redirect set up correctly on the site?
On the site https://24medcentr.com/ , it was necessary to set up a 301 redirect from http to https, and from www to without www.
Those. any request should redirect to https://24medcentr.com/
The hoster claims that everything is set up correctly.
But when I check the redirect, I get this picture:
i.e. the redirect from www.24medcentr.com goes to https://www.24medcentr.com , but it needs to go to https://24medcentr.com/
But when you open www.24medcentr.com , https://24medcentr opens in the browser . com/
Is this normal? Or the 301 redirect is not configured correctly.
I need it for Google. So that the snippet contains the site address without www. And in the site settings in the Google Search Console, I can’t select a domain without www, because this function is not available.
Answer the question
In order to leave comments, you need to log in
But after all, https://www.24medcentr.com/ still redirects to https://24medcentr.com/
You have everything set up correctly!
You now have the following situation:
And it should be like this:
Although, most likely this is not critical, honestly I don’t know, but you can configure it.
If you have Apache, in .htacess it is done like this:
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www.(.*)$ [NC]
RewriteRule ^(.*)$ https://%1/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !^443
RewriteRule (.*) https://24medcentr.com/$1 [R=301,L]
############################################################################
#### Выбор основного зеркала (с www или без www) ####
############################################################################
# 1. Удалить www
RewriteCond %{ENV:HTTPS} on
#Если включен https
RewriteRule .* - [E=SSL:s]
#То создаем переменную ssl с текстом s
RewriteCond %{HTTP_HOST} ^www\.(.*) [NC]
# Проверяем, содержит ли домен www в начале URL.
RewriteRule ^(.*)$ http%{ENV:SSL}://%1/$1 [R=301,L]
# Перенаправляем удаляем www
############################################################################
#### Перенаправляем протокол https на http ####
############################################################################
RewriteCond %{HTTPS} on
# Проверяем наличие https в URL.
RewriteRule ^.*$ http://%{SERVER_NAME}%{REQUEST_URI} [R=301,L]
# Перенаправляем протокол на http.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question