![]() |
Redirect Code Question - http to https Transition
Hello,
I was wondering if I could pick your brains. Most of my sites are https but I have a few that are over 15 years old that are still http. The main reason is that I have been afraid of not being able to transition properly. Google sees https as a brand new site and there are some horror stories out there of people who claim to have done everything right while transitioning and who still lost a good chuck of their traffic permanently. What I am concerned with specifically is what redirect code to use in my htaccess file. Over the years I've accumulated thousands of external links that are http. I also have thousands of internal links that are http, which would be too time consuming to change manually. How do I make sure that all of the external links, in all of their forms: Website Domain Names, Online Stores & Hosting | Domain.com Website Domain Names, Online Stores & Hosting | Domain.com Website Domain Names, Online Stores & Hosting | Domain.com ... redirect to the new https://domain.com/ And same question for all of the internal links. Ive played around with some 301 code I've found on substack and other coding forums with much smaller sites and it sometimes seems to work (although I don't know for sure) , and sometimes I get errors. Any thoughts? Or do you recommend any good people, companies who know their stuff to help me out? Thanks |
easiest way for old sites is probably htaccess.
Code:
RewriteEngine On |
Seen plenty slight variations to use in htaccess. These work ok for me.
Code:
# ensure www |
Its definitely time to make the switch to avoid any Google penalties for being on http. A 301 redirect as shown from other posts should do it, make sure you don't do a double redirect from http:// -> https:// and then another from the non-www version to the www version. (ie: http://sitename -> https://sitename-> https://www.sitename) as that will affect load time.
WG |
Do you use cloudflare? I think you can do it from there.
|
I read your question in its entirety... No backend tech advice from me(at least not in the technical sense used here). But I do have some words I'd like to share... And yes, you may pick my brain... There isn't a way to guarantee you won't lose a good chunk of your traffic... 'Permanently' is the operative word... You can always regain traffic if your site is still viable. Change is not easy when you know you will lose a great deal. Consider deciding what you are willing to let go... Let a good bit go that may not even be relevant anymore... Or a portion that isn't as vital... And focus on what you want to keep... Take your time with what you'd like to keep and move into the present.... before a choice is made for you... Not trying to scare you... but sometimes it is hard to do things when a lot is at stake... don't wait until you're backed into a corner and run out of time. <3
|
Thanks everyone for the replies. It's appreciated.
Two questions: For this code: "RewriteCond %{HTTPS} off" I've seen a variation where it says "on" instead off "off" at the end. What does that even mean and which is correct? Also, does my domain name fit anywhere into any of the htaccess codes in the examples above? Or do I copy and paste the code as is. Like I said, I've seen many variations and just want to make sure it's right. |
Quote:
RewriteCond %{HTTPS} on => if requested url is https, do what follows 2 - You don't need enter your domain name in any of the htaccess entries in this thread. The ones I posted should 301 the following to https://www.yourdomain.[tld]: http://yourdomain.[tld] http://www.yourdomain.[tld] www.yourdomain.[tld] https://yourdomain.[tld] If anything you add to .htaccess causes an issue, removing what you added should fix it in seconds. As plsureking put, the htaccess should have the RewriteEngine On line first. |
All times are GMT -7. The time now is 06:57 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc