Force panel into HTTPS / SSL

Want a new feature, we want to know about it. Any and all suggestions are welcomed.
Post Reply
Frozen
Posts: 53
Joined: Tue Mar 25, 2014 3:11 pm

Force panel into HTTPS / SSL

Post by Frozen »

Hello,

I was wondering if its possible to tell the panel that visits to port 80 (HTTP) are sent to port 443 (HTTPS)

I am running the control panels with SSL certificates, people browse to the panel using https:// without issues, however, if you write http:// instead it also works, I would like that once you write http:// it makes you use , or redirects atleast to the main page with https://

At the moment, as workaround, I have a second website inside IIS with a redirection from http://mypage to https://mypage, however, thats not optimal as I need other folders to be reachable at port 80, so a complete redirection is not the solution.

Is such implementation possible?
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Force panel into HTTPS / SSL

Post by Masher »

If the panel is in a subfolder of your site, you can force in IIS to require SSL for that application folder. The rest of the site should then still be accessible via port 80.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Frozen
Posts: 53
Joined: Tue Mar 25, 2014 3:11 pm

Re: Force panel into HTTPS / SSL

Post by Frozen »

Hello,

No, the website is under the wwwroot of IIS, not in a separate folder inside wwwroot if that is what you mean?
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Force panel into HTTPS / SSL

Post by Masher »

Don't think you have very many options other than moving it to a subfolder of the site, and requiring SSL for the application folder. You can also create a subdomain for just the panel and require SSL for it, but then you'll have to regenerate your certificates.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Frozen
Posts: 53
Joined: Tue Mar 25, 2014 3:11 pm

Re: Force panel into HTTPS / SSL

Post by Frozen »

So there's no possibility of having an option inside the panel (If enabled) all requests have to be done in https? Just like Joomla and others have?
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Force panel into HTTPS / SSL

Post by Masher »

I can probably come up with something.
Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Frozen
Posts: 53
Joined: Tue Mar 25, 2014 3:11 pm

Re: Force panel into HTTPS / SSL

Post by Frozen »

Would be great if you could, we're struggling with this since we are now running all our panels in https://

To achieve the https:// (guaranteed) we made a second website in IIS listening to port 80: that redirects all requests to https://panel.blabla.... so whenever a person writes http://panel.blabla it redirects to https://panel.blabla.

However, we need port 80 to work 'normally' in order to have LetsEncrypt (SSL) working correctly with the auto updating system, as now, all requests on 80 are being redirected, and therefore, also LetsEncrypt.
Masher
Site Admin
Posts: 3612
Joined: Thu Apr 20, 2006 2:54 pm
Location: America's Heartland
Contact:

Re: Force panel into HTTPS / SSL

Post by Masher »

I've implemented this. Go to the downloads area and get the package you need. Then add the following to the web.config in between the <appsettings> tags and edit as appropriate.

Code: Select all

    <!--Force https when accessing a page over http-->
    <add key="forcehttps" value="false"/>
    <!--If force https, enter the port to use.  443 is the default-->
    <add key="httpsport" value="443"/>

Masher
-----------
Please do not PM me unless asked to! We are a small company. If you have an issue or question it would be best to post it in the forums where it can help others in the future.

NEW Join our Discord!
Frozen
Posts: 53
Joined: Tue Mar 25, 2014 3:11 pm

Re: Force panel into HTTPS / SSL

Post by Frozen »

Works like a charm! Thank you so much!
Post Reply