Redirect from https to http problems

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
1) Site ssl certificate was cancelled
2) Links all over web points to https

a) htaccess rewrite rules don't seems to work

Can anyone perhaps help please?

Searched for hours but most redirect from http to https and I can also not found a solution for the problem where the original port 443 can be changed to port 80
 

InterServed

Well-Known Member
Jul 10, 2007
273
17
68
cPanel Access Level
DataCenter Provider
.htaccess , hope this is what you are looking for , and that it also works

Code:
Options +FollowSymlinks
RewriteEngine on
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*)$ http://www.yourdomain.com/$1 [R=301,L]
 

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
Secure Connection Failed

An error occurred during a connection to online-billing.co.za.

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

Seems that even while the link redirect to http the connection is still ssl (port 443) and thus give this error.
 
Last edited by a moderator:

InterServed

Well-Known Member
Jul 10, 2007
273
17
68
cPanel Access Level
DataCenter Provider
Secure Connection Failed

An error occurred during a connection to online-billing.co.za.

SSL received a record that exceeded the maximum permissible length.

(Error code: ssl_error_rx_record_too_long)

Seems that even while the link redirect to http the connection is still ssl (port 443) and thus give this error.
That could be related to a bad SSL Certificate installment. I still don't understand why do you try to redirect a secure connection to a non-secure while you could simple uninstall the certificate , in that case there will be no binding on ssl port 443 on your domain.
 
Last edited by a moderator:

Frankc

Well-Known Member
Jun 18, 2005
105
1
168
There was a certificate installed but removed from the server. Everything works fine but I forgot about the large number of https links at many different websites so ???? (Thank you for your replies so far)
 

garrettp

Well-Known Member
PartnerNOC
Jun 18, 2004
312
1
166
cPanel Access Level
DataCenter Provider
Unfortunately with the way that HTTPS works, you can't redirect HTTPS->HTTP without some sort of issue in this case. The SSL negotiation and connection is established first before any htaccess or even vhost redirects can happen. In the case that there is no SSL vhost on that IP (not listening on 443), an error will be seen like the one Frankc posted. If one is using a server-wide or self-generated cert, the usual "Certificate cannot be trusted" warning screen will be seen. In this latter case, once the certificate is accepted and the HTTPS connection fully established, then any vhost- or htaccess-level redirects will happen.

Realistically the only way to work around this problem is to purchase a (cheap) signed SSL cert for the domain so the redirection can happen without any interaction from the end-user.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
Otherwise, do a search on your files for all entries that have https and change them back to http. It would have been better to instead using the relative path to files without hard coding http or https in any of the files.
 

globule

Member
Mar 20, 2006
12
0
151
UK
Otherwise, do a search on your files for all entries that have https and change them back to http. It would have been better to instead using the relative path to files without hard coding http or https in any of the files.
The problem is that other sites link to his HTTPS URLs so a search and replace on his own site isn't going to help that.

Just buy a cheap SSL cert and job done.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
42
348
somewhere over the rainbow
cPanel Access Level
Root Administrator
The coding would still be advisable to be changed to use relative paths rather than absolute urls. It is not sound coding practice to use absolute urls with http or https in them. In my opinion, I would suggest to get this corrected now that the issue is known.