0

I am interested in technical considerations I should mind to safely switch my naked domain to a www. subdomain. By safely I mean things like not loosing SEO (redirects will suffice?) or avoiding some redirect loops (I imagine it's not hard to screw this up).

I would like to switch to a www subdomain, as I plan to scale the site up and would like to make use of cookie-less static.mydomain.com subdomain. (Yes, I know I could buy a separate domain for that, but I prefer not to.)

I am aware any cookie that has been already set on the naked domain will be sent to static.mydomain.com anyway. I'm interested in the solution nevertheless, even if only for the future users.

This question is not about DNS setup or server config, but rather general technical considerations I should care about when doing the switch.

If this helps anyone answering the question, feel free to inspect the cookies sent on the current naked domain: http://zadrutowani.pl

I'm aware it's non-SSL, I'm about to drop Wordpress altogether. Currently it's a WP on Apache, it'll be a custom solution on Nginx.

Tim
  • 33,870
  • 7
  • 56
  • 84
karni
  • 111

1 Answers1

1

I'm answering the question myself to save the readers having to go through the comments :) (Thank you to all involved!)

In particular case of my naked domain, the only cookies the site sent was Google Analytics (or none, if you had GA blocked in the browser). Hence, @MichaelHampton (btw, the author of yes-www) advised it should be safe to flip the switch and simply add www.

Note there may be an issue for users, who you may have redirected from www to the naked domain before with a 301. In case you'd redirect the naked domain to www now, there could be a redirect loop, of which case is documented here: The 301 'www' nightmare. How do I change back?

However, by inspecting the apache access logs I noticed none of our (30k+ unique) users accessed the site through www subdomain, therefore the 301 redirect from www to naked domain is a non issue.

Additionally, assuming URLs are properly redirected to the new www subdomain (in case adding www is no the only thing you're changing), this should not affect SEO. Remember to change your preferred canonical address in Google's Search Console.

Thank you, Michael Hampton :)! Your comments where key here.

karni
  • 111