|
Posted by Marcus Bointon on 11/11/05 13:50
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@synchromedia.co.uk | http://www.synchromedia.co.uk
Navigation:
[Reply to this message]
|