Re: mod_rewrite, apache2, php5RC1 and osx bsd

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

 



On 10 Nov 2005, at 21:36, Richard Lynch wrote:

On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
RewriteRule ^(.*)/(.*)/(.*)/(.*)/(.*)/(.+\.(video))$
../../phpscript.php

I should think all those .* should be .+ instead...

I mean, if somebody surfs to this URL:

http://example.com//////example.video

There's nothing really wrong with a URL like that, and I used to do the same thing until I discovered another fly in this particular ointment. Should source URLs like these ever appear in Microsoft Outlook, they are likely to get 'corrected', for example a URL that goes in as:

http://example.com//////example.video

When you click it, you're quite likely to have it go to:

http://example.com/example.video

thus completely missing all your mod_rewrite patterns. This is why we love MS so. I've taken up using _ as a pattern separator as a workaround.

There's also a very nasty bug in current mod_rewrite (at least in Apache 2.0.54) where mod_rewrite url decodes submatches between input and output URLs, so for example:

RewriteRule ^(.*) blah.php?x$1

if you feed that a URL that contains a URL encoded value like 'Hello% 20there', your resulting URL will be: 'blah.php?x=Hello there', which is obviously broken.

Marcus
--
Marcus Bointon
Synchromedia Limited: Putting you in the picture
marcus@xxxxxxxxxxxxxxxxxx | http://www.synchromedia.co.uk

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux