Htaccess redirects

Hi there. I am having a redirect issue I’m hoping you can help with.

http://soloENERGYbar.ca redirects correctly to the new website https://soloNUTRITION.ca
httpS://soloENERGYbar.ca errors out with an SSL issue.

I believe there is a way with HTACCESS to fix this, but I do not know how. GoDaddy (sigh) just says I need to purchase another one of their expensive SSL certificates and add it to this domain even though we’re just using it to redirect.

Any idea what we can do here?

Here’s my current HTACCESS file:

RewriteEngine on
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^ftp\.soloenergybars\.com$ [OR]
RewriteCond %{HTTP_HOST} ^www\.ftp\.soloenergybars\.com$
RewriteRule ^en\/home\/?(.*)$ "https\:\/\/www\.solonutrition\.ca\/$1" [R=301,L]

Thank you in advance!

The SSL certificate is just invalid, it’s for a different domain.

No amount of Apache redirects will solve that problem - you need a valid SSL certificate.

So you can go with GoDaddy or another certificate issuer. There is even Let’s Encrypt which issues SSL certificates for free.

1 Like

Okay, thank you for that answer! So in short if I assign an SSL to soloenergybar.ca it will redirect properly (like the non-https: version is) vs throwing an SSL error. Is that accurate?

Appreciate your help!

Just to clarify, even if this domain is not in use (it’s our old store URL) we cannot redirect this URL without keeping an SSL installed on it? Is that accurate?

http://soloENERGYBAR.ca (redirects properly)
https://soloENERGYBAR.ca (SSL error and does not redirect)

If we get an SSL added, it will correctly redirect to our new store URL which is: HTTPS://soloNUTRITION.ca

Thank you :slight_smile:

It is, yes. The browser attempts to connect using SSL, but fails because the certificate is incorrect. The browser does not know (nor should it) that if it could connect it would have been redirected; that’s step 2.

1 Like

Everything works for me.

1 Like

Update: I just go this fixed. Apparently I needed to add a www.shop and @ CNAME in the DNS, redirect the subdomain in cPanel subdomains, then place the HTACCESS code in the sub folder via:

RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?shop\.midwestsi\.com$
RewriteRule ^/?(.*)$ "https://www.midwestsi.com/supplies/$1" [R=301,QSA]

Thanks all for your help.

1 Like