Re: RedirectMatch - http://host/xyz[/abc] => http://xyz.host/[abc]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 17 August 2012 15:58, sebb <sebbaz@xxxxxxxxx> wrote:
> On 17 August 2012 15:30, Eric Covener <covener@xxxxxxxxx> wrote:
>>>> maybe RedirectMatch ^xyz(/.*)? http://xyz.host$1
>>>
>>> That won't match
>>>
>>> http://host/xyz
>>
>> question mark was part of the regex not punctuation,
>
> Very sorry, my bad, I should have read more carefully.
>
> Your suggestion will work fine.

Actually it does have a problem, because it matches
    http://host/xyz123
and redirects to
    http://xyz.host/
this is because it can match without the trailing context.

So I think one needs to anchor the regex:
    RedirectMatch ^xyz(/.*)?$ http://xyz.host$1

That seems to work OK.

Thanks for putting me on the right track.

>> but not sure the redirect w/o trailing slash is okay.
>
> It's OK if it is a directory.
>
> If xyz is a directory, then without the redirect, http://host/xyz should display
>
> http://host/xyz/index.html
>
> If http://host/xyz is redirected to
>
> http://xyz.host/
>
> This should result in displaying
>
> http://xyz.host/index.html
>
> as intended.
>
> Maybe your solution should be added as an example to the RedirectMatch docs?

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx



[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux