Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact us. |
|
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed. |
|
Thread Tools |
10-20-2023, 05:43 AM | #1 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,966
|
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 |
10-20-2023, 05:48 AM | #2 |
bored
Industry Role:
Join Date: Aug 2003
Location: Metaverse
Posts: 4,675
|
easiest way for old sites is probably htaccess.
Code:
RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI}
__________________
# |
10-20-2023, 06:35 AM | #3 |
Confirmed User
Industry Role:
Join Date: Jun 2019
Posts: 2,109
|
Seen plenty slight variations to use in htaccess. These work ok for me.
Code:
# ensure www RewriteCond %{HTTP_HOST} !^www\. [NC] RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # ensure https RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteCond %{HTTPS} off RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] |
10-20-2023, 07:33 AM | #4 |
Pounding Googlebot
Industry Role:
Join Date: Aug 2002
Location: Canada
Posts: 34,400
|
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
__________________
I play with Google. |
10-20-2023, 05:49 PM | #5 |
Confirmed User
Join Date: Jan 2003
Posts: 926
|
Do you use cloudflare? I think you can do it from there.
|
10-21-2023, 08:55 AM | #6 |
Confirmed User
Industry Role:
Join Date: Oct 2023
Location: The Stars
Posts: 10
|
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
|
10-23-2023, 04:39 AM | #7 |
Confirmed User
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,966
|
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. |
10-23-2023, 05:17 AM | #8 | |
Confirmed User
Industry Role:
Join Date: Jun 2019
Posts: 2,109
|
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. |
|
|
|||||||
Bookmarks |