HTTPS -> HTTP redirect

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
mrchasez
A semi-regular
A semi-regular
Posts: 23
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Tue Sep 27, 2011 7:16 am

HTTPS -> HTTP redirect

Post by mrchasez »

Hello,

How can I redirect https to http on my website. This is because my site doesn't have an SSL certificate nor does it need one. So if someone (even by accident) tries accessing my site via https:// it will say "No site is setup here" and redirect to NFO's website which is obviously bad and taking at least some traffic away.

So im looking for a solution.

Thanks
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: HTTPS -> HTTP redirect

Post by soja »

You should be able to do this using .htaccess.

Make a file called .htaccess in your public folder, and put this in it:

Code: Select all

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Found on: http://stackoverflow.com/questions/1299 ... g-htaccess
Not a NFO employee
User avatar
Edge100x
Founder
Founder
Posts: 12958
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: HTTPS -> HTTP redirect

Post by Edge100x »

What soja described won't work for a general account with us (that does not have SSL enabled). In the case of someone using https:// in that circumstance, the system can't tell that your account is the one they are attempting to view, so there isn't a setting on your side that would work to redirect the client.

This is something that I will have to investigate further.
mrchasez
A semi-regular
A semi-regular
Posts: 23
Joined: Tue Sep 27, 2011 7:16 am

Re: HTTPS -> HTTP redirect

Post by mrchasez »

Edge100x wrote:What soja described won't work for a general account with us (that does not have SSL enabled). In the case of someone using https:// in that circumstance, the system can't tell that your account is the one they are attempting to view, so there isn't a setting on your side that would work to redirect the client.

This is something that I will have to investigate further.
Please do. It really kind of sucks it can't be done right now.

Thanks
User avatar
Edge100x
Founder
Founder
Posts: 12958
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: HTTPS -> HTTP redirect

Post by Edge100x »

A redirect will likely never be possible here, due to the way that SSL works. The best that we could do is to disable HTTPS on the default server IP, which would make it so that clients who mistakenly type https:// would see a timeout.
User avatar
rymax99
This is my homepage
This is my homepage
Posts: 143
Joined: Sun Feb 02, 2014 2:08 pm
Location: Florida
Contact:

Re: HTTPS -> HTTP redirect

Post by rymax99 »

I'll throw in my 2 cents. In order for this to work, you'd need a SSL certificate installed to the server and configured, or a self signed one which would produce errors that ward off anyone that doesn't know exactly what the error/warning means. Therefore, in order to add a redirect that would even be worth it, it'd require paying/giving the certificate to NFO, which is possible, just not feasible if you've never used SSL on the site before which would've added links/actual reason for users to believe the SSL version of the site is the correct one.

Here's the warning that Chrome would show for a self signed certificate.
Image
In order to proceed, the user would have to click the 'advanced' button and choose to proceed.
User avatar
Edge100x
Founder
Founder
Posts: 12958
Joined: Thu Apr 18, 2002 11:04 pm
Location: Seattle
Contact:

Re: HTTPS -> HTTP redirect

Post by Edge100x »

rymax99, the complication is that SSL is IP-specific. For the redirect to work, a customer would need to have a site running on its own IP address. Due to the IP and administration overhead, we only currently support SSL for "Pro" plans.
Post Reply