You are viewing a plain text version of this content. The canonical link for it is here.
Posted to docs@httpd.apache.org by Issac Goldstand <ma...@beamartyr.net> on 2009/08/10 18:13:31 UTC

Patch for mod_alias.xml

Hi,
  After a colleague at work was struggling with the Redirect directive,
I realized that the docs could be a bit clearer.  I prepared a small
patch, but didn't want to commit myself simply because I'm not 100% sure
of the patch-xml/ant/html processes for committing doc patches.

This is against httpd-2.2.13 (should patch fine to trunk, too).

  Issac

Re: Patch for mod_alias.xml

Posted by Issac Goldstand <ma...@beamartyr.net>.
Nick Kew wrote:
>
> On 10 Aug 2009, at 17:13, Issac Goldstand wrote:
>
>> Hi,
>>   After a colleague at work was struggling with the Redirect directive,
>> I realized that the docs could be a bit clearer.
>
> Is this anything to do with PR#47644 ?
>
<sarcasm>I love how these issues always tend to magically appear days or
just weeks apart.  It's uncanny!</sarcasm>

It could be.  I'll glance at the code and tinker with the config and see
if it could be MultiViews related, and follow-up here.

  Issac

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Nick Kew <ni...@apache.org>.
On 10 Aug 2009, at 17:13, Issac Goldstand wrote:

> Hi,
>   After a colleague at work was struggling with the Redirect  
> directive,
> I realized that the docs could be a bit clearer.

Is this anything to do with PR#47644 ?

-- 
Nick Kew

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Issac Goldstand <ma...@beamartyr.net>.
Eric Covener wrote:
> On Mon, Aug 10, 2009 at 2:47 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
>   
>> Eric Covener wrote:
>>     
>>> On Mon, Aug 10, 2009 at 12:13 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
>>>
>>>       
>>>> Hi,
>>>>  After a colleague at work was struggling with the Redirect directive,
>>>> I realized that the docs could be a bit clearer.  I prepared a small
>>>> patch, but didn't want to commit myself simply because I'm not 100% sure
>>>> of the patch-xml/ant/html processes for committing doc patches.
>>>>
>>>> This is against httpd-2.2.13 (should patch fine to trunk, too).
>>>>
>>>>  Issac
>>>>
>>>> Index: manual/mod/mod_alias.xml
>>>> ===================================================================
>>>> --- manual/mod/mod_alias.xml    (revision 800376)
>>>> +++ manual/mod/mod_alias.xml    (working copy)
>>>> @@ -214,7 +214,8 @@
>>>>
>>>>     <p>Then any request beginning with <em>URL-Path</em> will return a
>>>>     redirect request to the client at the location of the target
>>>> -    <em>URL</em>.  Additional path information beyond the matched
>>>> +    <em>URL</em>.  If <em>URL-Path</em> ends with a trailing slash,
>>>> +    then additional path information beyond the matched
>>>>     <em>URL-Path</em> will be appended to the target URL.</p>
>>>>
>>>>         
>>> Can you demonstrate the trailing-slash/no-trailing-slash difference
>>> this is describing?  I wasn't able to recreate.
>>>
>>>
>>>       
>> Sure.  I'll do this from memory, but if you can't reproduce, I'll try to
>> get a hold of the old config that my colleague was bashing his head against.
>>
>> Let's say you have a line Redirect 301 /foo/bar. /baz/bar.extension
>>
>> One would assume from the docs that this would rewrite
>> /foo/bar.something to /baz/bar.extension.something
>>
>> However, this isn't the case, since /foo/bar.something doesn't end with
>> a / and therefore mod_alias is looking for an exact match (in
>> alias_matches) and the request doesn't get modified at all
>>
>> The redirect would need to be done using RedirectMatch or mod_rewrite
>>
>>     
>
> OK, i think it just needs more careful phrasing.  I read the updated
> behavior as implying:
>
> Redirect /a/b http://example.com/x
>
> Wouldn't send /a/b/c to http://example.com/x/c
>
> So it needs to capture that aspect of no-trailing-slash as well.
>
>   
That was the point.  It should convey that the auto-completion only
works if URL-Path ends with a /

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Eric Covener <co...@gmail.com>.
On Mon, Aug 10, 2009 at 2:47 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
> Eric Covener wrote:
>> On Mon, Aug 10, 2009 at 12:13 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
>>
>>> Hi,
>>>  After a colleague at work was struggling with the Redirect directive,
>>> I realized that the docs could be a bit clearer.  I prepared a small
>>> patch, but didn't want to commit myself simply because I'm not 100% sure
>>> of the patch-xml/ant/html processes for committing doc patches.
>>>
>>> This is against httpd-2.2.13 (should patch fine to trunk, too).
>>>
>>>  Issac
>>>
>>> Index: manual/mod/mod_alias.xml
>>> ===================================================================
>>> --- manual/mod/mod_alias.xml    (revision 800376)
>>> +++ manual/mod/mod_alias.xml    (working copy)
>>> @@ -214,7 +214,8 @@
>>>
>>>     <p>Then any request beginning with <em>URL-Path</em> will return a
>>>     redirect request to the client at the location of the target
>>> -    <em>URL</em>.  Additional path information beyond the matched
>>> +    <em>URL</em>.  If <em>URL-Path</em> ends with a trailing slash,
>>> +    then additional path information beyond the matched
>>>     <em>URL-Path</em> will be appended to the target URL.</p>
>>>
>>
>> Can you demonstrate the trailing-slash/no-trailing-slash difference
>> this is describing?  I wasn't able to recreate.
>>
>>
> Sure.  I'll do this from memory, but if you can't reproduce, I'll try to
> get a hold of the old config that my colleague was bashing his head against.
>
> Let's say you have a line Redirect 301 /foo/bar. /baz/bar.extension
>
> One would assume from the docs that this would rewrite
> /foo/bar.something to /baz/bar.extension.something
>
> However, this isn't the case, since /foo/bar.something doesn't end with
> a / and therefore mod_alias is looking for an exact match (in
> alias_matches) and the request doesn't get modified at all
>
> The redirect would need to be done using RedirectMatch or mod_rewrite
>

OK, i think it just needs more careful phrasing.  I read the updated
behavior as implying:

Redirect /a/b http://example.com/x

Wouldn't send /a/b/c to http://example.com/x/c

So it needs to capture that aspect of no-trailing-slash as well.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Bob Ionescu <bo...@googlemail.com>.
2009/8/10 Issac Goldstand <ma...@beamartyr.net>:
> Let's say you have a line Redirect 301 /foo/bar. /baz/bar.extension
>
> One would assume from the docs that this would rewrite
> /foo/bar.something to /baz/bar.extension.something
>
> However, this isn't the case, since /foo/bar.something doesn't end with
> a / and therefore mod_alias is looking for an exact match (in
> alias_matches) and the request doesn't get modified at all

Yes, but a request for /foo/bar./other/some would become
/baz/bar.extension/other/some with your redirect directive. So may be
you should word that the string compared against the URL-path argument
of the directive must have a slash beyond the match in order to append
additional path information to the URL-argument of the directive.

But may be "Additional path information" may word that already if
you're defining additional path information as /path/info and not foo.

Bob

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Issac Goldstand <ma...@beamartyr.net>.
Eric Covener wrote:
> On Mon, Aug 10, 2009 at 12:13 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
>   
>> Hi,
>>  After a colleague at work was struggling with the Redirect directive,
>> I realized that the docs could be a bit clearer.  I prepared a small
>> patch, but didn't want to commit myself simply because I'm not 100% sure
>> of the patch-xml/ant/html processes for committing doc patches.
>>
>> This is against httpd-2.2.13 (should patch fine to trunk, too).
>>
>>  Issac
>>
>> Index: manual/mod/mod_alias.xml
>> ===================================================================
>> --- manual/mod/mod_alias.xml    (revision 800376)
>> +++ manual/mod/mod_alias.xml    (working copy)
>> @@ -214,7 +214,8 @@
>>
>>     <p>Then any request beginning with <em>URL-Path</em> will return a
>>     redirect request to the client at the location of the target
>> -    <em>URL</em>.  Additional path information beyond the matched
>> +    <em>URL</em>.  If <em>URL-Path</em> ends with a trailing slash,
>> +    then additional path information beyond the matched
>>     <em>URL-Path</em> will be appended to the target URL.</p>
>>     
>
> Can you demonstrate the trailing-slash/no-trailing-slash difference
> this is describing?  I wasn't able to recreate.
>
>   
Sure.  I'll do this from memory, but if you can't reproduce, I'll try to
get a hold of the old config that my colleague was bashing his head against.

Let's say you have a line Redirect 301 /foo/bar. /baz/bar.extension

One would assume from the docs that this would rewrite
/foo/bar.something to /baz/bar.extension.something

However, this isn't the case, since /foo/bar.something doesn't end with
a / and therefore mod_alias is looking for an exact match (in
alias_matches) and the request doesn't get modified at all

The redirect would need to be done using RedirectMatch or mod_rewrite



---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org


Re: Patch for mod_alias.xml

Posted by Eric Covener <co...@gmail.com>.
On Mon, Aug 10, 2009 at 12:13 PM, Issac Goldstand<ma...@beamartyr.net> wrote:
> Hi,
>  After a colleague at work was struggling with the Redirect directive,
> I realized that the docs could be a bit clearer.  I prepared a small
> patch, but didn't want to commit myself simply because I'm not 100% sure
> of the patch-xml/ant/html processes for committing doc patches.
>
> This is against httpd-2.2.13 (should patch fine to trunk, too).
>
>  Issac
>
> Index: manual/mod/mod_alias.xml
> ===================================================================
> --- manual/mod/mod_alias.xml    (revision 800376)
> +++ manual/mod/mod_alias.xml    (working copy)
> @@ -214,7 +214,8 @@
>
>     <p>Then any request beginning with <em>URL-Path</em> will return a
>     redirect request to the client at the location of the target
> -    <em>URL</em>.  Additional path information beyond the matched
> +    <em>URL</em>.  If <em>URL-Path</em> ends with a trailing slash,
> +    then additional path information beyond the matched
>     <em>URL-Path</em> will be appended to the target URL.</p>

Can you demonstrate the trailing-slash/no-trailing-slash difference
this is describing?  I wasn't able to recreate.

-- 
Eric Covener
covener@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: docs-unsubscribe@httpd.apache.org
For additional commands, e-mail: docs-help@httpd.apache.org