Author Topic: Force SSL on all website links  (Read 854 times)

0 Members and 1 Guest are viewing this topic.

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2253
    • CNYWeather
Force SSL on all website links
« on: February 27, 2022, 09:20:09 AM »
I've moved the website and now have a SSL Certificate.
There are a lot of old search links and bookmarks that are http and i've been trying to force redirect them
to https on the website with numerous htaccess rules.

From some searching this is what I have in there now:

Code: [Select]
RewriteEngine On
RewriteBase /

RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^cnyweather\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.cnyweather\.com$
RewriteRule .* https://cnyweather.com%{REQUEST_URI} [R=301,L]


RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}

RewriteEngine On
RewriteBase /
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]


I've set up Google Search Console with the new https address for the website.
Something else that I can put in there to redirect the old links to SSL?
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4109
    • Colorado Springs Weather
Re: Force SSL on all website links
« Reply #1 on: May 30, 2022, 10:49:00 AM »
Tony,

I'm having the same issue. I just got a SSL as well.




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Hikvision HD IP Camera

Offline WeatherHost

  • Forecaster
  • *****
  • Posts: 3617
Re: Force SSL on all website links
« Reply #2 on: May 30, 2022, 12:53:00 PM »
Open the source code for your page(s) in a text editor.

Search/Find and Replace all instances of ' http: ' with ' https: '.

Should happen fairly quickly. 

Paste the edited code back into your webpage.



Or is that not what you want to do?

Offline CNYWeather

  • Forecaster
  • *****
  • Posts: 2253
    • CNYWeather
Re: Force SSL on all website links
« Reply #3 on: May 30, 2022, 02:25:10 PM »
Open the source code for your page(s) in a text editor.

Search/Find and Replace all instances of ' http: ' with ' https: '.

Should happen fairly quickly. 

Paste the edited code back into your webpage.



Or is that not what you want to do?

I have all my content with https now.

There are a lot of search engine crawl links that are from the unsecure site. I'd like them to redirect
to their proper https page now. I tried a few different htaccess tricks but still haven't accomplished what i'm trying to do.




And Ryan, I ended up moving my site from GoDaddy since they wanted too much for an SSL certificate and went with
IONOS which included it in the cost of hosting, plus it was significantly cheaper than GoDaddy. I was with them for 15 years
and they could care less that I left lol.
Tony




Offline cospringswx

  • Forecaster
  • *****
  • Posts: 4109
    • Colorado Springs Weather
Re: Force SSL on all website links
« Reply #4 on: June 08, 2022, 09:22:04 PM »
Open the source code for your page(s) in a text editor.

Search/Find and Replace all instances of ' http: ' with ' https: '.

Should happen fairly quickly. 

Paste the edited code back into your webpage.



Or is that not what you want to do?

I have all my content with https now.

There are a lot of search engine crawl links that are from the unsecure site. I'd like them to redirect
to their proper https page now. I tried a few different htaccess tricks but still haven't accomplished what i'm trying to do.




And Ryan, I ended up moving my site from GoDaddy since they wanted too much for an SSL certificate and went with
IONOS which included it in the cost of hosting, plus it was significantly cheaper than GoDaddy. I was with them for 15 years
and they could care less that I left lol.

I got one free Tony




Ryan 

Colorado Springs, CO
www.cospringsweather.com
Davis Vantage Vue
Weather Display Software
Hikvision HD IP Camera