Offsite changes to make after switching to SSL

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
I have one more question about the redirects.

The redirect that I posted above will redirect someone from
Code:
http://www.mysite.com
OR
Code:
http://mysite.come
to
Code:
https://www.mysite.com
I like it that way, always using the www.

But if someone just types mysite.com in then it remains without the www.

And Google's spider does too, I assume.

So should I add a second redirect to take people from
Code:
https://mysite.come
to
Code:
https://www.mysite.com
?
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
Can you post the redirection code you used?
Sure. Right now the only redirection code I have for this type of thing is what GoDaddy put in when they switched my site from http to https. It's what I posted earlier in the thread, this code:

Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteCond %{HTTP_HOST} ^(www\.)?mysite\.com$ [NC]
RewriteRule ^(.*)$ https://mysite.com/$1 [L,R=301]
</IfModule>
 

djbaxter

Administrator
Administrator
Joined
Jun 28, 2012
Messages
2,875
Sometimes you have to play with the RewriteRule line a bit for different server configurations.

Comment out this line by inserting the character # at the beginning of the line:
Code:
# RewriteRule ^(.*)$ https://mysite.com/$1 [L,R=301]
Then try this right below that commented out line:
Code:
RewriteRule ^\$\/?(.*)$ "https\:\/\/www\.mysite\.com\/\$$1" [R=301,L]
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
I will try that when I get back to the office.

In the meantime I have a question just for my own curiosity. Is it good practice to have a redirect from mysite.com to www.mysite.com? Or is this just me trying to appease my OCD? :giggle:
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
Yes, I have cPanel.

What I meant to ask is if it matters if someone could go to either www. or just mysite.com without the www.? Is it important to redirect to one or the other?
 

Tony Wang

Member
Joined
Oct 13, 2014
Messages
128
Technically, it doesn't matter which url the typical user lands on. But yes, you should redirect everything to your canonical url, that's one of the signals that tells Google what your canonical url is.
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
cPanel >> Domains >> Redirects
  • Set Type to permanent (301)
  • Set https?://(www.)? to your domain
  • Leave the box after / blanck
  • Redirects to https://yourdomain.com
  • Select Redirect with or without www
  • Check Wildcard redirect
That didn't work. When typing in the domain without www. it still goes there, it doesn't get redirected to www.

Furthermore, and I know this might sound crazy, but when I entered that as you specified, it actually deleted an existing redirect. I remember there was an odd redirect at the very top of the Current Redirect list, and now it is gone. And now when typing http (without the s) of my website in it will take me to a non-secure version. So I lost that main redirect that GoDaddy added. I don't know why adding a redirect thru cPanel would remove an existing one.
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
So I checked the htaccess. It changed the redirect that GoDaddy added that I posted in the second post to this:
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
</IfModule>
So I pasted the original code back in htaccess and all is well.
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
When typing just the website in, it will forward from mydomain.com to www.mydomain.com.

but if I type in https://mydomain.com it will stay there (no www.) as I surf the site
 

djbaxter

Administrator
Administrator
Joined
Jun 28, 2012
Messages
2,875
Did you try what I suggested earlier?

Sometimes you have to play with the RewriteRule line a bit for different server configurations.

Comment out this line by inserting the character # at the beginning of the line:
Code:
# RewriteRule ^(.*)$ https://mysite.com/$1 [L,R=301]
Then try this right below that commented out line:
Code:
RewriteRule ^\$\/?(.*)$ "https\:\/\/www\.mysite\.com\/\$$1" [R=301,L]
 

Wirenut

Member
Joined
Oct 26, 2019
Messages
50
I did mention out the line and add your line like you said. It's still doing the same thing.

The first post I had on this topic was a little off. As I clarified above, it only does it when typing https://mydomain.com which is an odd thing to do. I don't know if anyone or any spider would ever do that.

When typing mydomain.com (without the https in front of it) it goes to www.mydomain.com like it's supposed to.
 

Weekly Digest

Weekly Digest
Subscribe/Unsubscribe

Promoted Posts

New advertising option: A review of your product or service posted by a Sterling Sky employee. This will also be shared on the Sterling Sky & LSF Twitter accounts, our Facebook group, LinkedIn, and both newsletters. More...

Local Search Forum


Google Product Exert

@LocalSearchLink

Join Our Facebook Group

Top