NEED URGENT HELP: Query Related To Google Search Console!

alchemyst

Active member
Feb 24, 2020
278
87
28
Hello Guys!

Need some urgent help on this one.

I want to ask does google treat www and non-www versions of my site as two completely different websites?

Here is the issue I am facing. My current live site is on the non-www version and I did the mistake of submitting my site to google search console using www version (Yup, foolish of me, I know :D).

Although I have submitted the correct version to GSC too (non-www), I was wondering what else do I need to do to fix this.

Appreciate any help.

Thanks.
 

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
Just do a permanent redirect (301) in your .htaccess file, like so:
Code:
RewriteEngine on

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

This assumes your website has an SSL-certificate, in other words https instead of http
Add the above code to the top of your .htaccess file.
 
  • Like
Reactions: alchemyst

alchemyst

Active member
Feb 24, 2020
278
87
28
Hey @frizzel

Thank you for taking the time to reply. :)

I will create a 301 redirect right now as directed.

One other doubt that I am having is, right now on my GSC I have two sitemaps submitted.
One for the www version(which isn't my live site) and one for non-www version which is in fact the live site.

Some www versions of my site are appearing in SERPs.

So will the redirect take care of the sitemap as well and can I remove the non-existent www property from the GSC completely once I have set the redirect so that only the non-www results remain in SERPs?

Please advise.

Thanks :)
 

frizzel

Well-known member
Trusted Uploader
Jun 13, 2019
485
253
63
Wherever my imagination takes me
Yes, you should remove the www-sitemap from GSC.

Because you have a permanent redirect, over time Google will replace the www-versions with the non-www versions. But give it time, be patient, it can take from weeks to months. Re-submitting your non-www-sitemap might help, but that's not guaranteed.
 
  • Like
Reactions: alchemyst

alchemyst

Active member
Feb 24, 2020
278
87
28
Brilliant, I will get on it straight away.

One last thing, just clarifying,in the code snippet shared above I don't need to put in my site URL right?

I see the logic behind it, redirect everything www to https://

P.S. : Yes, my site is indeed has secure SSL certificate.
 

About us

  • Our community has been around for many years and pride ourselves on offering unbiased, critical discussion among people of all different backgrounds. We are working every day to make sure our community is one of the best.

Quick Navigation

User Menu