You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Jan <ja...@tofuwurst.org> on 2008/06/14 13:41:20 UTC

[users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?

Hi!

I have just noticed yesterday that one of my mod_rewrite rules which works fine in Apache 2.0 doesn't seem to work in Apache 2.2.

Here is the rule:

RewriteRule ^portfolio/([0-9]+)(/)?$ portfolio.php?serie=$1

So a request to portfolio/ID is supposed to be send to portfolio.php?serie=ID. This works fine on the Apache 2.0 installation but on the Apache 2.2 server the ID is somehow not passed to the script.

However, when I change the rule to:

RewriteRule ^folio/([0-9]+)(/)?$ portfolio.php?serie=$1

and call the page with folio/ID it is passed to the script. Alternatively it also works when I rename the file to something != rewrite rule, instead of changing the redirect.

Is this supposed to be this way? Again, it works in Apache 2.0 as expected, but not in Apache 2.2.

Any comments on this issue will are greatly appreciated.

Thanks,
Jan







---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: Re: [users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?

Posted by Jan <ja...@tofuwurst.org>.
Hi!

Thanks for the MultiViews hint, that seems to solve the problem. I have now disabled MultiViews in the specific directory and it seems to be working now.

We also had the mod_speling idea, but the results with enabled and disabled mod_speling were the same.

Thanks for the useful hints,
Jan


----- Original Message -----
From: pytechd@gmail.com
To: users@httpd.apache.org
Date: 15.06.2008 18:59:13
Subject: Re: [users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?


> Do you have MultiViews enabled under 2.2 but not under 2.0?
> 

> >
> > Hi,
> >
> > just another wild speculation: As it does work with "folio" but not with
> > "portfolio" (which happens to be the name of the PHP file): Could it be that
> > you have mod_speling turned on in your Apache 2.2 installation and had it
> > turned off in Apache 2.0? I suppose that mod_speling "corrects" the
> > unavailable "portfolio" to the only alternative, portfolio.php, BEFORE any
> > RewriteRule matches, and thus does not pass the ID.
> >
> > Sascha
> >





---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?

Posted by Eric <py...@gmail.com>.
Do you have MultiViews enabled under 2.2 but not under 2.0?

On Sun, Jun 15, 2008 at 9:09 AM, Sascha Kersken <sk...@lingoworld.de> wrote:
> Krist van Besien schrieb:
>>
>> On Sat, Jun 14, 2008 at 13:41, Jan <ja...@tofuwurst.org> wrote:
>>
>>>
>>> Hi!
>>>
>>> I have just noticed yesterday that one of my mod_rewrite rules which
>>> works fine in Apache 2.0 doesn't seem to work in Apache 2.2.
>>>
>>> Here is the rule:
>>>
>>> RewriteRule ^portfolio/([0-9]+)(/)?$ portfolio.php?serie=$1
>>>
>>> So a request to portfolio/ID is supposed to be send to
>>> portfolio.php?serie=ID. This works fine on the Apache 2.0 installation but
>>> on the Apache 2.2 server the ID is somehow not passed to the script.
>>>
>>> However, when I change the rule to:
>>>
>>> RewriteRule ^folio/([0-9]+)(/)?$ portfolio.php?serie=$1
>>>
>>> and call the page with folio/ID it is passed to the script. Alternatively
>>> it also works when I rename the file to something != rewrite rule, instead
>>> of changing the redirect.
>>>
>>> Is this supposed to be this way? Again, it works in Apache 2.0 as
>>> expected, but not in Apache 2.2.
>>>
>>> Any comments on this issue will are greatly appreciated.
>>>
>>
>> This is quite odd, and should not happen. There might be something
>> else in your config interfering. Have you turned on RewriteLog with a
>> sufficiently high loglevel? The rewrite log should tell you what
>> matches are tried.
>>
>>
>
> Hi,
>
> just another wild speculation: As it does work with "folio" but not with
> "portfolio" (which happens to be the name of the PHP file): Could it be that
> you have mod_speling turned on in your Apache 2.2 installation and had it
> turned off in Apache 2.0? I suppose that mod_speling "corrects" the
> unavailable "portfolio" to the only alternative, portfolio.php, BEFORE any
> RewriteRule matches, and thus does not pass the ID.
>
> Sascha
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>  "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>
>

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?

Posted by Sascha Kersken <sk...@lingoworld.de>.
Krist van Besien schrieb:
> On Sat, Jun 14, 2008 at 13:41, Jan <ja...@tofuwurst.org> wrote:
>   
>> Hi!
>>
>> I have just noticed yesterday that one of my mod_rewrite rules which works fine in Apache 2.0 doesn't seem to work in Apache 2.2.
>>
>> Here is the rule:
>>
>> RewriteRule ^portfolio/([0-9]+)(/)?$ portfolio.php?serie=$1
>>
>> So a request to portfolio/ID is supposed to be send to portfolio.php?serie=ID. This works fine on the Apache 2.0 installation but on the Apache 2.2 server the ID is somehow not passed to the script.
>>
>> However, when I change the rule to:
>>
>> RewriteRule ^folio/([0-9]+)(/)?$ portfolio.php?serie=$1
>>
>> and call the page with folio/ID it is passed to the script. Alternatively it also works when I rename the file to something != rewrite rule, instead of changing the redirect.
>>
>> Is this supposed to be this way? Again, it works in Apache 2.0 as expected, but not in Apache 2.2.
>>
>> Any comments on this issue will are greatly appreciated.
>>     
>
> This is quite odd, and should not happen. There might be something
> else in your config interfering. Have you turned on RewriteLog with a
> sufficiently high loglevel? The rewrite log should tell you what
> matches are tried.
>
>   
Hi,

just another wild speculation: As it does work with "folio" but not with 
"portfolio" (which happens to be the name of the PHP file): Could it be 
that you have mod_speling turned on in your Apache 2.2 installation and 
had it turned off in Apache 2.0? I suppose that mod_speling "corrects" 
the unavailable "portfolio" to the only alternative, portfolio.php, 
BEFORE any RewriteRule matches, and thus does not pass the ID.

Sascha


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] mod_rewrite difference Apache 2.0 and 2.2 ?

Posted by Krist van Besien <kr...@gmail.com>.
On Sat, Jun 14, 2008 at 13:41, Jan <ja...@tofuwurst.org> wrote:
> Hi!
>
> I have just noticed yesterday that one of my mod_rewrite rules which works fine in Apache 2.0 doesn't seem to work in Apache 2.2.
>
> Here is the rule:
>
> RewriteRule ^portfolio/([0-9]+)(/)?$ portfolio.php?serie=$1
>
> So a request to portfolio/ID is supposed to be send to portfolio.php?serie=ID. This works fine on the Apache 2.0 installation but on the Apache 2.2 server the ID is somehow not passed to the script.
>
> However, when I change the rule to:
>
> RewriteRule ^folio/([0-9]+)(/)?$ portfolio.php?serie=$1
>
> and call the page with folio/ID it is passed to the script. Alternatively it also works when I rename the file to something != rewrite rule, instead of changing the redirect.
>
> Is this supposed to be this way? Again, it works in Apache 2.0 as expected, but not in Apache 2.2.
>
> Any comments on this issue will are greatly appreciated.

This is quite odd, and should not happen. There might be something
else in your config interfering. Have you turned on RewriteLog with a
sufficiently high loglevel? The rewrite log should tell you what
matches are tried.

Krist

-- 
krist.vanbesien@gmail.com
krist@vanbesien.org
Bremgarten b. Bern, Switzerland
--
A: It reverses the normal flow of conversation.
Q: What's wrong with top-posting?
A: Top-posting.
Q: What's the biggest scourge on plain text email discussions?

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org