Problems switching from http to https

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

Problems switching from http to https

by frye-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


I'm playing around with the UrlRewiteFilter and I want to be able to
switch a user from 'http' to 'https' if she goes to any URIs under
webkell or authenticate ( ex. http://URL1/webkell/some_location ->
https://URL1/webkell/some_location ). But I'm getting a redirect error
that the redirect will never complete ( see attached image ).

I tried to specify that the client protocol should be http. But that
doesn't seem to stop the recursive loop. Is there an easy way to
specify the switch between http and https?

        <rule>
                <condition name="host" operator="notequal">^http:\/\/
(.*)$</condition>
                <from>^/webkell/(.*)$</from>
                <to type="redirect">https://bkeeping.com/webkell/$1</
to>
        </rule>

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problems switching from http to https

by Avlesh Singh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Your condition is incorrect. You condition is on the host, which is always not equal to "http://"; host header does not (and never includes the protocol or scheme). Hence the redirect rule has become an infinite rule. The client browser in such cases aborts the request.

Changing
<condition name="host" operator="notequal">^http:\/\/(.*)$</condition>
to
<condition name="scheme" operator="notequal">^http$</condition>
should work fine.

Cheers
Avlesh

On Sun, Sep 27, 2009 at 3:32 AM, frye <twashing@...> wrote:

I'm playing around with the UrlRewiteFilter and I want to be able to
switch a user from 'http' to 'https' if she goes to any URIs under
webkell or authenticate ( ex. http://URL1/webkell/some_location ->
https://URL1/webkell/some_location ). But I'm getting a redirect error
that the redirect will never complete ( see attached image ).

I tried to specify that the client protocol should be http. But that
doesn't seem to stop the recursive loop. Is there an easy way to
specify the switch between http and https?

       <rule>
               <condition name="host" operator="notequal">^http:\/\/
(.*)$</condition>
               <from>^/webkell/(.*)$</from>
               <to type="redirect">https://bkeeping.com/webkell/$1</
to>
       </rule>

Thanks




--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problems switching from http to https

by frye-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Hey there, thanks for the reply. So before, clients were going into a
recursive loop. I tried both of these, but neither redirected to
https.

<condition name="scheme" operator="notequal">^http$</condition>
        - doesn't redirect to https
<condition name="scheme" operator="notequal">^https$</condition>
        - doesn't redirect to https

So I want to redirect "http://bkeeping.com/webkell/*" requests to
https.
And the idea here is make sure that when the client is redirected
under the https protocol, they do not go into a recursive loop (which
was happening earlier). This is confusing because it looks so
straightforward, but there's obviously something I'm missing. How do
you turn on DEBUG logging in this thing ( I didn't see it in the
docs ) ?

        <rule>
                <condition name="scheme" operator="notequal">^https$</
condition>
                <from>^/webkell/(.*)$</from>
                <to type="redirect">https://bkeeping.com/webkell/$1</
to>
        </rule>


Thanks
Tim


On Sep 27, 1:19 am, Avlesh Singh <avl...@...> wrote:

> Your condition is incorrect. You condition is on the host, which is always
> not equal to "http://"; host header does not (and never includes the
> protocol or scheme). Hence the redirect rule has become an infinite rule.
> The client browser in such cases aborts the request.
>
> Changing
> <condition name="host" operator="notequal">^http:\/\/(.*)$</condition>
> to
> <condition name="scheme" operator="notequal">^http$</condition>
> should work fine.
>
> Cheers
> Avlesh
>
> On Sun, Sep 27, 2009 at 3:32 AM, frye <twash...@...> wrote:
>
> > I'm playing around with the UrlRewiteFilter and I want to be able to
> > switch a user from 'http' to 'https' if she goes to any URIs under
> > webkell or authenticate ( ex.http://URL1/webkell/some_location->
> >https://URL1/webkell/some_location). But I'm getting a redirect error
> > that the redirect will never complete ( see attached image ).
>
> > I tried to specify that the client protocol should be http. But that
> > doesn't seem to stop the recursive loop. Is there an easy way to
> > specify the switch between http and https?
>
> >        <rule>
> >                <condition name="host" operator="notequal">^http:\/\/
> > (.*)$</condition>
> >                <from>^/webkell/(.*)$</from>
> >                <to type="redirect">https://bkeeping.com/webkell/$1</
> > to>
> >        </rule>
>
> > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problems switching from http to https

by Avlesh Singh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I copy pasted your incorrect snippet back :) The attribute to be used is "type" and not "name"
If the underneath does not work for you, there has to be some misconfiguration somewhere else.

<rule>
   <condition type="scheme" operator="equal">^http$</condition>
   <from>^/webkell/(.*)$</from>
   <to type="redirect">https://bkeeping.com/webkell/$1</to>
</rule>

Cheers
Avlesh

On Sun, Sep 27, 2009 at 8:39 PM, frye <twashing@...> wrote:

Hey there, thanks for the reply. So before, clients were going into a
recursive loop. I tried both of these, but neither redirected to
https.

<condition name="scheme" operator="notequal">^http$</condition>
       - doesn't redirect to https
<condition name="scheme" operator="notequal">^https$</condition>
       - doesn't redirect to https

So I want to redirect "http://bkeeping.com/webkell/*" requests to
https.
And the idea here is make sure that when the client is redirected
under the https protocol, they do not go into a recursive loop (which
was happening earlier). This is confusing because it looks so
straightforward, but there's obviously something I'm missing. How do
you turn on DEBUG logging in this thing ( I didn't see it in the
docs ) ?

       <rule>
               <condition name="scheme" operator="notequal">^https$</
condition>
               <from>^/webkell/(.*)$</from>
               <to type="redirect">https://bkeeping.com/webkell/$1</
to>
       </rule>


Thanks
Tim


On Sep 27, 1:19 am, Avlesh Singh <avl...@...> wrote:
> Your condition is incorrect. You condition is on the host, which is always
> not equal to "http://"; host header does not (and never includes the
> protocol or scheme). Hence the redirect rule has become an infinite rule.
> The client browser in such cases aborts the request.
>
> Changing
> <condition name="host" operator="notequal">^http:\/\/(.*)$</condition>
> to
> <condition name="scheme" operator="notequal">^http$</condition>
> should work fine.
>
> Cheers
> Avlesh
>
> On Sun, Sep 27, 2009 at 3:32 AM, frye <twash...@...> wrote:
>
> > I'm playing around with the UrlRewiteFilter and I want to be able to
> > switch a user from 'http' to 'https' if she goes to any URIs under
> > webkell or authenticate ( ex.http://URL1/webkell/some_location->
> >https://URL1/webkell/some_location). But I'm getting a redirect error
> > that the redirect will never complete ( see attached image ).
>
> > I tried to specify that the client protocol should be http. But that
> > doesn't seem to stop the recursive loop. Is there an easy way to
> > specify the switch between http and https?
>
> >        <rule>
> >                <condition name="host" operator="notequal">^http:\/\/
> > (.*)$</condition>
> >                <from>^/webkell/(.*)$</from>
> >                <to type="redirect">https://bkeeping.com/webkell/$1</
> > to>
> >        </rule>
>
> > Thanks



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---


Re: Problems switching from http to https

by frye-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message


Yes, that was it. Sweet, thanks :)

Tim


On Sep 27, 12:03 pm, Avlesh Singh <avl...@...> wrote:

> I copy pasted your incorrect snippet back :) The attribute to be used is
> "type" and not "name"
> If the underneath does not work for you, there has to be some
> misconfiguration somewhere else.
>
> <rule>
>    <condition *type*="scheme" operator="equal">^http$</condition>
>    <from>^/webkell/(.*)$</from>
>    <to type="redirect">https://bkeeping.com/webkell/$1</to>
> </rule>
>
> Cheers
> Avlesh
>
> On Sun, Sep 27, 2009 at 8:39 PM, frye <twash...@...> wrote:
>
> > Hey there, thanks for the reply. So before, clients were going into a
> > recursive loop. I tried both of these, but neither redirected to
> > https.
>
> > <condition name="scheme" operator="notequal">^http$</condition>
> >         - doesn't redirect to https
> > <condition name="scheme" operator="notequal">^https$</condition>
> >        - doesn't redirect to https
>
> > So I want to redirect "http://bkeeping.com/webkell/*" requests to
> > https.
> > And the idea here is make sure that when the client is redirected
> > under the https protocol, they do not go into a recursive loop (which
> > was happening earlier). This is confusing because it looks so
> > straightforward, but there's obviously something I'm missing. How do
> > you turn on DEBUG logging in this thing ( I didn't see it in the
> > docs ) ?
>
> >        <rule>
> >                <condition name="scheme" operator="notequal">^https$</
> > condition>
> >                <from>^/webkell/(.*)$</from>
> >                <to type="redirect">https://bkeeping.com/webkell/$1</
> > to>
> >        </rule>
>
> > Thanks
> > Tim
>
> > On Sep 27, 1:19 am, Avlesh Singh <avl...@...> wrote:
> > > Your condition is incorrect. You condition is on the host, which is
> > always
> > > not equal to "http://"; host header does not (and never includes the
> > > protocol or scheme). Hence the redirect rule has become an infinite rule.
> > > The client browser in such cases aborts the request.
>
> > > Changing
> > > <condition name="host" operator="notequal">^http:\/\/(.*)$</condition>
> > > to
> > > <condition name="scheme" operator="notequal">^http$</condition>
> > > should work fine.
>
> > > Cheers
> > > Avlesh
>
> > > On Sun, Sep 27, 2009 at 3:32 AM, frye <twash...@...> wrote:
>
> > > > I'm playing around with the UrlRewiteFilter and I want to be able to
> > > > switch a user from 'http' to 'https' if she goes to any URIs under
> > > > webkell or authenticate ( ex.http://URL1/webkell/some_location->
> > > >https://URL1/webkell/some_location). But I'm getting a redirect error
> > > > that the redirect will never complete ( see attached image ).
>
> > > > I tried to specify that the client protocol should be http. But that
> > > > doesn't seem to stop the recursive loop. Is there an easy way to
> > > > specify the switch between http and https?
>
> > > >        <rule>
> > > >                <condition name="host" operator="notequal">^http:\/\/
> > > > (.*)$</condition>
> > > >                <from>^/webkell/(.*)$</from>
> > > >                <to type="redirect">https://bkeeping.com/webkell/$1</
> > > > to>
> > > >        </rule>
>
> > > > Thanks
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "UrlRewrite" group.
To post to this group, send email to urlrewrite@...
To unsubscribe from this group, send email to urlrewrite+unsubscribe@...
For more options, visit this group at http://groups.google.com/group/urlrewrite?hl=en
-~----------~----~----~----~------~----~------~--~---