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.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 10-20-2023, 05:43 AM   #1
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,967
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
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2023, 05:48 AM   #2
plsureking
bored
 
plsureking's Avatar
 
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}
#
__________________
#
plsureking is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2023, 06:35 AM   #3
JustBiz
Confirmed User
 
JustBiz's Avatar
 
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]
JustBiz is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2023, 07:33 AM   #4
WiredGuy
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.
WiredGuy is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-20-2023, 05:49 PM   #5
money biz
Confirmed User
 
Join Date: Jan 2003
Posts: 929
Do you use cloudflare? I think you can do it from there.
money biz is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-21-2023, 08:55 AM   #6
sukiyaki_x
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
sukiyaki_x is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-23-2023, 04:39 AM   #7
mopek1
Confirmed User
 
Industry Role:
Join Date: Jun 2004
Location: Canada
Posts: 2,967
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.
mopek1 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 10-23-2023, 05:17 AM   #8
JustBiz
Confirmed User
 
JustBiz's Avatar
 
Industry Role:
Join Date: Jun 2019
Posts: 2,109
Quote:
Originally Posted by mopek1 View Post
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.
1 - RewriteCond %{HTTPS} off => if requested url is http, do what follows
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.
JustBiz is online now   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks

Tags
links, http, redirect, https, code, people, transition, thousands, internal, external, sites, question, www.domain.com, time, https://domain.com, consuming, manually, change, forms, http://domain.com, http://www.domain.com, coding, errors, recommend, stuff



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.