Forums

Resolved
0 votes
I was wondering if there is any configuration in ClearOS for settingup a https redirect for the webconfig.

i now manualy opend the flex-80.conf of httpd to add some lines of code as showed below.


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/?(.*) https://%{SERVER_NAME}/$1 [R,L]


Is there in the webconfig a setting that could do this for me because every time i change something in the webserver i have to add this manualy ?
Would be nice if i setup a SSL-cert to a webserver is automaticly adds those lines of code to the webserver running on port 80. Or just a extra setting in the vhost on the webconfig to enable http to https redirect that add those lines of code.

Already tryed with "Port Forwarding" app but that doesn't work on my side.
Friday, December 08 2017, 05:03 PM
Share this post:
Responses (7)
  • Accepted Answer

    Friday, December 08 2017, 05:43 PM - #Permalink
    Resolved
    0 votes
    There is no option to do as you want. Also can I suggest you don't do edits to flex-80.conf or flex-443.conf as you will lost them next time the webconfig writes to the files. I'm not good a websites, but I think it may be better to do what you want with a .htaccess file.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, December 08 2017, 05:54 PM - #Permalink
    Resolved
    0 votes
    just added a flexshare an checked te posibilitys with that there is also a web thing on it but in there is a possibility to setup portforwarding. But for the webserver it's not.
    i think i will fix it as you say with the .htaccess file but would be nice if its in the httpd config of in the webconfig of the webserver.
    The reply is currently minimized Show
  • Accepted Answer

    Friday, December 08 2017, 07:04 PM - #Permalink
    Resolved
    0 votes
    I cannot see how "port forwarding" would help. In reality you would not port forward but use a PREROUTING rule to DNAT from port 80 to port 443, but then a browser/client would see https traffic/handshaking over port 80 as far as it is concerned and I would have thought it would find it a little odd. Do you think it would force it to switch to 443?
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, December 09 2017, 12:57 PM - #Permalink
    Resolved
    0 votes
    I was searching the ClearOS forum and there was sombody that did it by using portforwarding.
    I think because of the intergration of Lets Encrypt it would be nice to have a feature like enable rewrite in the webconfig for the webserver.
    The reply is currently minimized Show
  • Accepted Answer

    Saturday, December 09 2017, 01:39 PM - #Permalink
    Resolved
    0 votes
    I can file a feature request and see what happens. I suspect it might be a while.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, December 10 2017, 04:03 PM - #Permalink
    Resolved
    0 votes
    I think a feature request will be great.
    The reply is currently minimized Show
  • Accepted Answer

    Sunday, December 10 2017, 07:03 PM - #Permalink
    Resolved
    0 votes
    The reply is currently minimized Show
Your Reply