Force all to https

I can’t work out in the stack of apache/tomcat/lucee how to compulsorily
force https use.

I’ve currently only got this in my apache virtualhost 80 configuration:

Redirect permanent “/” “https://mysite.com/

but its not working :confused:

Am I putting this in the right layer of the cake?

Would this approach work better:

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
        RewriteRule ^(.*)$ https://mysite.com$1 [L,R=301]

or should I just go and ask in an apache forum. Ah me. To bed.

What’s the virtual host block look like in Apache. That should work:

<VirtualHost *:80>
ServerName mysite.com
ServerAlias *.mysite.com
Redirect permanent / https://mysite.com/

Is there a conflicting host name or default server that’s overriding?On November 18, 2015 at 6:48:06 PM, Tim Clarke (@Tim_Clarke) wrote:

I can’t work out in the stack of apache/tomcat/lucee how to compulsorily force https use.

I’ve currently only got this in my apache virtualhost 80 configuration:

Redirect permanent “/” “https://mysite.com/

but its not working :confused:

Am I putting this in the right layer of the cake?

Would this approach work better:

        RewriteEngine On
        RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
        RewriteRule ^(.*)$ https://mysite.com$1 [L,R=301]

or should I just go and ask in an apache forum. Ah me. To bed.

Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/6ff9afed-32b4-4c8d-a077-0f01e1911b09%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Your last VirtualHost block, the default SSL, is configured to endlessly redirect. You shouldn’t have a RedirectPermanent directive there.

If you’re getting the Lucee welcome page after you change that, then there’s likely an issue with your Tomcat host config directory for the site (or you have a rewrite rule in place that is unable to resolve.)> On Nov 19, 2015, at 6:42 AM, Tim Clarke <@Tim_Clarke> wrote:

That’s what I have, I think. After some fiddling those two sites demo and main work OK with this:

<VirtualHost *:80>
ServerName demomysite.com
Redirect permanent / https://mysite.com/

ProxyPass http://demomysite.com:8888/
ProxyPassReverse http://demomysite.com:8888/

<VirtualHost *:443>
ServerName demo.mysite.com
Redirect permanent / https://mysite.com/
(ssl config lines…)

ProxyPass https://demomysite.com:8888/
ProxyPassReverse https://demomysite.com:8888/

ServerName mysite.com Redirect permanent / https://mysite.com/ ProxyPass http://mysite.com:8888/ ProxyPassReverse http://mysite.com:8888/ ServerName mysite.com Redirect permanent / https://mysite.com/ (ssl config lines....) ProxyPass https://mysite.com:8888/ ProxyPassReverse https://mysite.com:8888/

but if I go to the IP address for the server I get the Lucee welcome page now despite those default entries :frowning:

Love Lucee? Become a supporter and be part of the Lucee project today! - http://lucee.org/supporters/become-a-supporter.html

You received this message because you are subscribed to the Google Groups “Lucee” group.
To unsubscribe from this group and stop receiving emails from it, send an email to lucee+unsubscribe@googlegroups.com.
To post to this group, send email to lucee@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/lucee/79d3c842-d0f5-40c6-bc8c-d88f7f525bf1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

That’s what I have, I think. After some fiddling those two sites demo and
main work OK with this:

<VirtualHost *:80>
ServerName demomysite.com
Redirect permanent / https://mysite.com/

ProxyPass http://demomysite.com:8888/
ProxyPassReverse http://demomysite.com:8888/

<VirtualHost *:443>
ServerName demo.mysite.com
Redirect permanent / https://mysite.com/
(ssl config lines…)

ProxyPass https://demomysite.com:8888/
ProxyPassReverse https://demomysite.com:8888/

ServerName mysite.com Redirect permanent / https://mysite.com/ ProxyPass http://mysite.com:8888/ ProxyPassReverse http://mysite.com:8888/ ServerName mysite.com Redirect permanent / https://mysite.com/ (ssl config lines....) ProxyPass https://mysite.com:8888/ ProxyPassReverse https://mysite.com:8888/

but if I go to the IP address for the server I get the Lucee welcome page
now despite those default entries :frowning:

Your last VirtualHost block, the default SSL, is configured to endlessly
redirect. You shouldn’t have a RedirectPermanent directive there.

If you’re getting the Lucee welcome page after you change that, then
there’s likely an issue with your Tomcat host config directory for the site
(or you have a rewrite rule in place that is unable to resolve.)

Sorry - cut-and-paste fail - that last RedirectPermanent is not there.On Thursday, 19 November 2015 12:00:40 UTC, Jon Clausen wrote: