htaccess, mod rewrite to https help please?

Wayne Hunt

Member
Hi guys,

Forgive the stupid questions, but I need your help please?

Last week, Paul helped me upgrade two sites from 1.5.1 to 2.1.8. Long story as to why I waited so long, but it's done, and I'm very grateful.

There is now a "not secure" message popping up which is bothering my visitors. I'm on a Hostgator reseller account, so I've got SSL available, and typing in https:// instead of http:// works.

I've changed the site URL to https: in the site options, and that works, but everyone's got bookmarks and everything, and somehow keep swapping back and forth between http: and https:

A friend suggested that I can alter the .htaccess file to use a mod rewrite to go from http to https across the board, but I have no idea how to do that. I know how to access and edit the file of course, just not how to write the command that goes inside it.

Any advise or help please?

Wayne
 
if you don't use www's:

Code:
RewriteCond %{HTTPS} off  [OR]
RewriteCond %{HTTP_HOST} !(^yoursite\.com$)
RewriteRule (.*) https://yoursite.com/$1 [L,R=301]

if you do use www's

Code:
RewriteCond %{HTTPS} off  [OR]
RewriteCond %{HTTP_HOST} !(^www\.yoursite\.com$)
RewriteRule (.*) https://yoursite.com/$1 [L,R=301]


Also,. enable image and link proxy's if you haven't yet to avoid the non-ssl content throwing errors
 
Thank you everyone, very much for your help and responses. I'll try the latter two before messing with the htaccess route, but it's good information to have when I get there.
 
Also,. enable image and link proxy's if you haven't yet to avoid the non-ssl content throwing errors
Forgive me, I truly appreciate the help, but I don't know how to do that either. Any guidance please?

I see the options at /admin.php?options/groups/imageLinkProxy/#imageLinkProxy but where would I get the secret key?

(I've never dealt with SSL before)
 
Back
Top Bottom