Bad request when users goto http://www.mydomain.com:443

View: New views
3 Messages — Rating Filter:   Alert me  

Bad request when users goto http://www.mydomain.com:443

by DeanoUK :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We get the following error:

Bad Request

Your browser sent a request that this server could not understand.
Reason: You're speaking plain HTTP to an SSL-enabled server port.
Instead use the HTTPS scheme to access this URL, please.

    Hint: https://www.mydomain.com/

When users go to http//www.mydomain.com:443 - which we obviously need to
catch and redirect to https://www.mydomain.com 

What's the best way of achieving this?

We have two virtual hosts setup one on port 80 (which is already
redirecting http traffic on port 80 to https on port 443) and one on
443.
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users@...
Automated List Manager                            majordomo@...

Parent Message unknown Re: Bad request when users goto http://www.mydomain.com:443

by Glyn Astill :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Possibly use a RewriteRule or something of the sort?

RewriteEngine On
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
RewriteCond %{SERVER_PORT} ^443$
RewriteRule ^(.*) https://www.mydomain.com/$1 [R=301,L]

I've not tested that, and I doub't it's spot on but hopefully it's the right direction...

----- Original Message ----

> From: Dean Pullen <dean.pullen@...>
> To: modssl-users@...
> Sent: Monday, 31 March, 2008 5:34:38 PM
> Subject: Bad request when users goto http://www.mydomain.com:443
>
> We get the following error:
>
> Bad Request
>
> Your browser sent a request that this server could not understand.
> Reason: You're speaking plain HTTP to an SSL-enabled server port.
> Instead use the HTTPS scheme to access this URL, please.
>
>     Hint: https://www.mydomain.com/
>
> When users go to http//www.mydomain.com:443 - which we obviously need to
> catch and redirect to https://www.mydomain.com 
>
> What's the best way of achieving this?
>
> We have two virtual hosts setup one on port 80 (which is already
> redirecting http traffic on port 80 to https on port 443) and one on
> 443.
> ______________________________________________________________________
> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> User Support Mailing List                      modssl-users@...
> Automated List Manager                            majordomo@...
>




      __________________________________________________________
Sent from Yahoo! Mail.
A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html

______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users@...
Automated List Manager                            majordomo@...

Re: Bad request when users goto http://www.mydomain.com:443

by Walt Williams :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The rewriterule can be explointed on unpatched Apache.  If you're
doing this, make certain you're working with the current patch.

Otherwise, use an application layer redirector/load balancer.

Walt

On 3/31/08, Glyn Astill <glynastill@...> wrote:

> Possibly use a RewriteRule or something of the sort?
>
> RewriteEngine On
> RewriteCond %{HTTP_HOST} .
> RewriteCond %{HTTP_HOST} ^www\.mydomain\.com$
> RewriteCond %{SERVER_PORT} ^443$
> RewriteRule ^(.*) https://www.mydomain.com/$1 [R=301,L]
>
> I've not tested that, and I doub't it's spot on but hopefully it's the right direction...
>
> ----- Original Message ----
> > From: Dean Pullen <dean.pullen@...>
> > To: modssl-users@...
> > Sent: Monday, 31 March, 2008 5:34:38 PM
> > Subject: Bad request when users goto http://www.mydomain.com:443
> >
> > We get the following error:
> >
> > Bad Request
> >
> > Your browser sent a request that this server could not understand.
> > Reason: You're speaking plain HTTP to an SSL-enabled server port.
> > Instead use the HTTPS scheme to access this URL, please.
> >
> >     Hint: https://www.mydomain.com/
> >
> > When users go to http//www.mydomain.com:443 - which we obviously need to
> > catch and redirect to https://www.mydomain.com
> >
> > What's the best way of achieving this?
> >
> > We have two virtual hosts setup one on port 80 (which is already
> > redirecting http traffic on port 80 to https on port 443) and one on
> > 443.
> > ______________________________________________________________________
> > Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> > User Support Mailing List                      modssl-users@...
> > Automated List Manager                            majordomo@...
> >
>
>
>
>
>      __________________________________________________________
> Sent from Yahoo! Mail.
> A Smarter Inbox http://uk.docs.yahoo.com/nowyoucan.html
>
> ______________________________________________________________________
> Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
> User Support Mailing List                      modssl-users@...
> Automated List Manager                            majordomo@...
>


--
Walt Williams, CISSP, SSCP
______________________________________________________________________
Apache Interface to OpenSSL (mod_ssl)                   www.modssl.org
User Support Mailing List                      modssl-users@...
Automated List Manager                            majordomo@...
LightInTheBox - Buy quality products at wholesale price