Bluehost.com Web Hosting $6.95

mod_rewrite/Win32

This is a discussion on mod_rewrite/Win32 within the Apache Web Server forums, part of the Web Server and Related Forums category; I have Apache 1.3.33 on my local Win32 machine and generally try to keep the same environment locally ...


Go Back   Usenet Forums > Web Server and Related Forums > Apache Web Server

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-18-2006
Thomas Lauer
 
Posts: n/a
Default mod_rewrite/Win32

I have Apache 1.3.33 on my local Win32 machine and generally try to keep
the same environment locally as on the web server that hosts my pages.
And mainly that approach works very well indeed.

But there's one thing I simply don't understand. I have this url:
http://example.com/StartThis/ and I want this to end up as
http://example.com/startthat/

Trivial one-liner with mod_rewrite. But this only works correctly on the
remote web server and *not* on my local machine. After some lengthy
trial and error sessions I seem to have found a possible reason: it
looks as if mod_rewrite -- but only on Win32 -- gets all its strings
already in lowercase, so the match never happens.

Am I overlooking something obvious? Or is that known behaviour?

--
cheers thomasl

mail: thomas.lauer@virgin.net
  #2 (permalink)  
Old 01-19-2006
Robert Ionescu
 
Posts: n/a
Default Re: mod_rewrite/Win32

Thomas Lauer wrote:
> I have Apache 1.3.33 on my local Win32 machine

[...]
> But there's one thing I simply don't understand. I have this url:
> http://example.com/StartThis/ and I want this to end up as
> http://example.com/startthat/
>
> Trivial one-liner with mod_rewrite. But this only works correctly on the
> remote web server and *not* on my local machine. After some lengthy
> trial and error sessions I seem to have found a possible reason: it
> looks as if mod_rewrite -- but only on Win32 -- gets all its strings
> already in lowercase, so the match never happens.


Did you check the RewriteLog (needs to be enabled first, use
RewriteLoglevel 5)

> Am I overlooking something obvious? Or is that known behaviour?


AFAIK there was something... but check the RwriteLog.

--
Robert
  #3 (permalink)  
Old 01-19-2006
Thomas Lauer
 
Posts: n/a
Default Re: mod_rewrite/Win32

Robert Ionescu <robsiegen@googlemail.com> wrote:

> > But there's one thing I simply don't understand. I have this url:
> > http://example.com/StartThis/ and I want this to end up as
> > http://example.com/startthat/
> >
> > Trivial one-liner with mod_rewrite. But this only works correctly on the
> > remote web server and *not* on my local machine. After some lengthy
> > trial and error sessions I seem to have found a possible reason: it
> > looks as if mod_rewrite -- but only on Win32 -- gets all its strings
> > already in lowercase, so the match never happens.

>
> Did you check the RewriteLog (needs to be enabled first, use
> RewriteLoglevel 5)


I did. That's how I realised that mod_rewrite gets the strings seemingly
all in lowercase. If I try to load http://example.com/StartThis/ what
actually appears as incoming in the RewriteLog is
http://example.com/startthis/, from the very first line. (And there's no
rule in my ruleset that would change case anyway.)

Hm...?

--
cheers thomasl

mail: thomas.lauer@virgin.net
  #4 (permalink)  
Old 01-22-2006
Robert Ionescu
 
Posts: n/a
Default Re: mod_rewrite/Win32

Thomas Lauer wrote:
> Robert Ionescu <robsiegen@googlemail.com> wrote:
>
>>> But there's one thing I simply don't understand. I have this url:
>>> http://example.com/StartThis/ and I want this to end up as
>>> http://example.com/startthat/
>>>
>>> Trivial one-liner with mod_rewrite. But this only works correctly on the
>>> remote web server and *not* on my local machine. After some lengthy
>>> trial and error sessions I seem to have found a possible reason: it
>>> looks as if mod_rewrite -- but only on Win32 -- gets all its strings
>>> already in lowercase, so the match never happens.

>> Did you check the RewriteLog (needs to be enabled first, use
>> RewriteLoglevel 5)

>
> I did. That's how I realised that mod_rewrite gets the strings seemingly
> all in lowercase. If I try to load http://example.com/StartThis/ what
> actually appears as incoming in the RewriteLog is
> http://example.com/startthis/, from the very first line. (And there's no
> rule in my ruleset that would change case anyway.)


It seems that mod_rewrite receives in per-server context the URL in its
correct case,

init rewrite engine with requested uri /hAllo/
applying pattern '^/hAllO' to uri '/hAllo/'
pass through /hAllo/

but it does not match without ine NC-Flag so there must be sthg. else
between mod_rewrite and the regEx engine.

In per-dir context, a URL-to-filename translation has already taken
place, so may be all files are resolved in lowercase on systems, where
the case doesn't matter? So mod_rewrite receives a lowercase filepath here.

--
Robert
  #5 (permalink)  
Old 01-23-2006
Thomas Lauer
 
Posts: n/a
Default Re: mod_rewrite/Win32

Robert Ionescu <robsiegen@googlemail.com> wrote:

> Thomas Lauer wrote:
> > Robert Ionescu <robsiegen@googlemail.com> wrote:
> >
> >>> But there's one thing I simply don't understand. I have this url:
> >>> http://example.com/StartThis/ and I want this to end up as
> >>> http://example.com/startthat/
> >>>
> >>> Trivial one-liner with mod_rewrite. But this only works correctly on the
> >>> remote web server and *not* on my local machine. After some lengthy
> >>> trial and error sessions I seem to have found a possible reason: it
> >>> looks as if mod_rewrite -- but only on Win32 -- gets all its strings
> >>> already in lowercase, so the match never happens.
> >> Did you check the RewriteLog (needs to be enabled first, use
> >> RewriteLoglevel 5)

> >
> > I did. That's how I realised that mod_rewrite gets the strings seemingly
> > all in lowercase. If I try to load http://example.com/StartThis/ what
> > actually appears as incoming in the RewriteLog is
> > http://example.com/startthis/, from the very first line. (And there's no
> > rule in my ruleset that would change case anyway.)

>
> It seems that mod_rewrite receives in per-server context the URL in its
> correct case,
>
> init rewrite engine with requested uri /hAllo/
> applying pattern '^/hAllO' to uri '/hAllo/'
> pass through /hAllo/
>
> but it does not match without ine NC-Flag so there must be sthg. else
> between mod_rewrite and the regEx engine.
>
> In per-dir context, a URL-to-filename translation has already taken
> place, so may be all files are resolved in lowercase on systems, where
> the case doesn't matter? So mod_rewrite receives a lowercase filepath here.


Unfortunately, I can only use mod_rewrite in a per-dir context (I can of
course use it on my local machine in whatever way I please but that
would defeat the original purpose: to have exactly the same setup
locally and remote).

Anyway, perhaps something along these lines (i.e. Win32 being a
case-insensitive system so it shouldn't matter anyway whether or not the
incoming pathnames and filenames are lowercase) is happening here.

However, the days when a URI contained real filenames are long gone.
mod_rewrite itself is one of the greatest tools to perform all sorts of
remappings between arbitrary input strings and real filenames.

This limitation (if it is indeed a limitation and not some odd
configuration option I have overlooked) is a rather severe one, all the
more as it renders a Win32 Apache incompatible to its *x sibling.

Sigh.

--
cheers thomasl

mail: thomas.lauer@virgin.net
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:42 PM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0