I have a free SSL certificate (brand new website), redirected all HTTP URLs to HTTPS. In my sitemap, all URLs are HTTPS. I added my sitemap to the Google search console. However, when I search my posts in Google, HTTP URLs appear in the results. Is this a bad situation for Seo? How can I prevent indexing HTTP URLs? Should I? I really don't know why do my pages appear as HTTP in the results.
-
4When you click the HTTP result in Google Search, does it take you to an HTTP page, or is it automatically redirected to the HTTPS version?– Maximillian Laumeister ♦Commented Sep 8, 2021 at 17:24
-
3That's an interesting question. I've seen Google continue to index some HTTP URLs for months after a site switches from HTTP to HTTPS, but I'm surprised that Google might index HTTP URLs for a site that has been HTTPS from the beginning.– Stephen Ostermiller ♦Commented Sep 8, 2021 at 17:34
-
3Can you share a link to the site with us?– Stephen Ostermiller ♦Commented Sep 8, 2021 at 17:36
-
2"I have a free SSL certificate (brand new website), redirected all HTTP URLs to HTTPS." If it is a brand new website, why do you bother at all to make it reply to HTTP? Make it run only on HTTPS. Browsers now try HTTPS before HTTP anyway.– Patrick MevzekCommented Sep 8, 2021 at 19:04
-
2Are you doing 301 or 302 redirects?– davidgoCommented Sep 8, 2021 at 20:16
1 Answer
I can't think of any reason besides these. It could also be bug on Google's end.
I'm assuming we've already ruled out automatic redirection per Max's question and your answer.
Directory & File Permissions are Not Set Properly
If your directory/file permissions are set up incorrectly it is possible that your whole file structure could be indexed. The redirects could be perfectly fine and this could happen if certain files/directories are accessible.
Permissions that would allow this would also present a large security vulnerability. For proof that this can happen please see this Google Support answer.
Do a site:
search like MrWhite asked - if this is the case, it will be very obvious.
Also as MrWhite asked - make sure you've set up the property in Google Search Console. I recommend using the Domain Property option.
I use this command a lot after freshly installing WordPress on Ubuntu + Nginx/Apache.
chown -R www-data: /var/www/html
find /var/www/html -type d -exec chmod 750 {} \;
find /var/www/html -type f -exec chmod 640 {} \;
As root of course.
Ensure Canonical URLs are not HTTP
Within Search Console, use the URL inspection tool to check what your User Declared Canonical is. This it will show the status of the page when Google last crawled it.
If you see http
update your canonical URLs to use
https
. If there is no User Declared Canonical, it means that you don't have them set - which you should then change, and go back to Search Console and request indexing to your root domain.
-
If you run that command be sure to replace info with your document root beforehand. Those permissions are specific to WordPress. Commented Sep 9, 2021 at 0:09