You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@trafficserver.apache.org by "Ye, Hong" <Ho...@cable.comcast.com> on 2013/12/18 16:42:42 UTC

Use regex_remap to do URL redirect in ats 4.0.1

Hi James, Leif and anyone:


I am still having problem to make following URL redirect working in 4.0.1. I need to make following source URL:


http://xfinity.net


to be redirected (regex) to following:


^/x1platform(.*) https://spectrum.comcast.net/webportal/ @status=301

^/x1(.*) http://xfinity.comcast.net/x1/ @status=301

^/(.*) http://xfinity.comcast.net @status=301

Could you please share your opinion how I should make it work?


Best Regards

Hong Ye
DNS, Product Engineering
Comcast National Engineering & Technical Operations
Desk:    215-286-4488  Cell:     267-273-8368

Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by Leif Hedstrom <zw...@apache.org>.
On Dec 18, 2013, at 4:20 PM, James Peach <jp...@apache.org> wrote:

> On Dec 18, 2013, at 3:15 PM, Leif Hedstrom <zw...@apache.org> wrote:
> 
>> 
>> On Dec 18, 2013, at 8:42 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:
>> 
>>> Hi James, Leif and anyone:
>>> 
>>> 
>>> I am still having problem to make following URL redirect working in 4.0.1. I need to make following source URL:
>>> 
>>> 
>>> http://xfinity.net
>> 
>> Pretty sure your problem is
>> 
>> CONFIG proxy.config.body_factory.enable_customizations INT 0
>> 
>> 
>> you need to enable that. See 
>> 
>> https://cwiki.apache.org/confluence/display/TS/Upgrading+to+v4.0#Upgradingtov4.0-BodyFactorynowusedforCustomizableUserResponsePages
> 
> Is there a Jira ticket for that? If it is required, shouldn't we force that setting to 1 and remove it?


There’s a Jira on that link, TS-2217. But yeah, that’s a fine question! Bryan, or Carlin (or Igor), why did we even leave this configuration there? It seems allowing a crippling configuration is bad mojo? At a minimum, shouldn’t we disallow the ‘0’ setting?

Cheers,

— Leif


Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by James Peach <jp...@apache.org>.
On Dec 18, 2013, at 3:15 PM, Leif Hedstrom <zw...@apache.org> wrote:

> 
> On Dec 18, 2013, at 8:42 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:
> 
>> Hi James, Leif and anyone:
>> 
>> 
>> I am still having problem to make following URL redirect working in 4.0.1. I need to make following source URL:
>> 
>> 
>> http://xfinity.net
> 
> Pretty sure your problem is
> 
> CONFIG proxy.config.body_factory.enable_customizations INT 0
> 
> 
> you need to enable that. See 
> 
> https://cwiki.apache.org/confluence/display/TS/Upgrading+to+v4.0#Upgradingtov4.0-BodyFactorynowusedforCustomizableUserResponsePages

Is there a Jira ticket for that? If it is required, shouldn't we force that setting to 1 and remove it?

J


Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by "Ye, Hong" <Ho...@cable.comcast.com>.
Hi Leif and all, 

Thanks a bunch! It did the trick.

I tested on 3.2.4 with setting it to 1. Seems it is working good too.
Before I update this config in puppet
repository to push out to all the servers, I just want to confirm with you
that it will not cause other
problem. I should be ok, right?
 


Best Regards

Hong Ye
DNS, Product Engineering
Comcast National Engineering & Technical Operations
Desk:    215-286-4488  Cell:     267-273-8368




On 12/18/13 6:15 PM, "Leif Hedstrom" <zw...@apache.org> wrote:

>
>On Dec 18, 2013, at 8:42 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:
>
>> Hi James, Leif and anyone:
>> 
>> 
>> I am still having problem to make following URL redirect working in
>>4.0.1. I need to make following source URL:
>> 
>> 
>> http://xfinity.net
>
>Pretty sure your problem is
>
>CONFIG proxy.config.body_factory.enable_customizations INT 0
>
>
>you need to enable that. See
>
>https://cwiki.apache.org/confluence/display/TS/Upgrading+to+v4.0#Upgrading
>tov4.0-BodyFactorynowusedforCustomizableUserResponsePages
>
>
>Cheers,
>
>‹ leif
>


Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by Leif Hedstrom <zw...@apache.org>.
On Dec 19, 2013, at 7:26 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:

> Seems the config is for "errors". In case case, there is no error for my
> request and response.
> Is there something missing while processing regex_remap request? (or from
> the plugin?)

Misnomer, it’s for all response bodies generated by ATS itself. That includes redirects as you are using the plugin, since ATS has to generate the response.

Yes, you should be able to enable this on all versions. The difference being that it’s used the body factory templates instead of the old hardcoded (C++) templates. Those hardcoded templates were removed in v4.x, and that’s why you can’t turn off the body templates if you want ATS to generate these pages.

I’ve filed a followup bug on fixing some of this confusion.

Cheers,

— Leif


Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by "Ye, Hong" <Ho...@cable.comcast.com>.
Seems the config is for "errors". In case case, there is no error for my
request and response.
Is there something missing while processing regex_remap request? (or from
the plugin?)


Best Regards

Hong Ye
DNS, Product Engineering
Comcast National Engineering & Technical Operations
Desk:    215-286-4488  Cell:     267-273-8368




On 12/18/13 6:15 PM, "Leif Hedstrom" <zw...@apache.org> wrote:

>
>On Dec 18, 2013, at 8:42 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:
>
>> Hi James, Leif and anyone:
>> 
>> 
>> I am still having problem to make following URL redirect working in
>>4.0.1. I need to make following source URL:
>> 
>> 
>> http://xfinity.net
>
>Pretty sure your problem is
>
>CONFIG proxy.config.body_factory.enable_customizations INT 0
>
>
>you need to enable that. See
>
>https://cwiki.apache.org/confluence/display/TS/Upgrading+to+v4.0#Upgrading
>tov4.0-BodyFactorynowusedforCustomizableUserResponsePages
>
>
>Cheers,
>
>‹ leif
>


Re: Use regex_remap to do URL redirect in ats 4.0.1

Posted by Leif Hedstrom <zw...@apache.org>.
On Dec 18, 2013, at 8:42 AM, Ye, Hong <Ho...@cable.comcast.com> wrote:

> Hi James, Leif and anyone:
> 
> 
> I am still having problem to make following URL redirect working in 4.0.1. I need to make following source URL:
> 
> 
> http://xfinity.net

Pretty sure your problem is

CONFIG proxy.config.body_factory.enable_customizations INT 0


you need to enable that. See 

https://cwiki.apache.org/confluence/display/TS/Upgrading+to+v4.0#Upgradingtov4.0-BodyFactorynowusedforCustomizableUserResponsePages


Cheers,

— leif