问题原文
原帖链接 · Abdulla · CC BY-SA 3.0
I moved my HTTP site to HTTPS last month. Earlier I had a search console property for http://www.example.com. Now I created a new property for https://www.example.com
(also created property for http://example.com and https://example.com, just to see what it shows).
But the Google index status is showing 0 for my https://www.example.com. Why is that so? The index for the previous property is still showing (though slowly decreasing). Does Google consider my site as 'not adding any value' since there is already an HTTP version? Should I remove other three properties?
I am working on Magento site. It provides settings to use secure URL and I have done that. In addition I have added redirect to HTTPS in .htaccess file.
My robots.txt file just contains this one line:
User-agent: *
The number of pages indexed in sitemap is same in HTTPS and HTTP.
Edit :
.htaccess file :
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.whitesouq.com/$1 [R=301,L]
# All explanations you could find in .htaccess.sample file
DirectoryIndex index.php
RewriteCond %{REQUEST_URI} ^/(index.php/)?admin/ [NC]
RewriteCond %{REMOTE_ADDR} !^124.40.244.18
RewriteRule ^(.*)$ https://%{HTTP_HOST}/ [R=302,L]
已采纳解答
原帖链接 · TopQnA · CC BY-SA 3.0
What you have done in search console looks fine.
The only thing i would say is when you redirected from http://www to https://www make sure the http to https redirect response is 301.
Also, make sure all other version of URLs (http://, https://, http://www.) redirects to preferred URL (https://www.) and the server response should be 301.
Once this is done, you don't need to anything else and in search console just look at your preferred URL property.
.htaccess code to directed to: https://www.example.com.au in Magento:
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{HTTPS} on
RewriteCond %{HTTP_HOST} !^www\.(.*)$ [NC]
RewriteRule ^(.*)$ https://www.%{HTTP_HOST}/$1 [R=301,L]
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]
#RewriteEngine on
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
