Re: mod_rewrite, apache2, php5RC1 and osx bsd

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

 



On Wed, November 9, 2005 10:36 pm, Dan Rossi wrote:
> Hi there, ive been having issues with mod_rewrite and apache2 with PHP
> 5.1RC1. I have googled the php bugs and people have been experiencing
> the same issue however the php people cant see to reproduce the bug.
> Its most definately doing it for me, here is a rewrite rule i have
> setup, if i [L] to a php script, it either tries to download the faked
> url file or hangs.  I reverted back to 5.1.0b2 and it works fine ??
> What do i do ?
>
> 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

Do you really want that to hit ../../phpscript.php

This probably will not fix your bug, mind you, but it's probably worth
trying just to see.

I think you could also lose all those ()s in the Regex, as you don't
seem to be doing anything with them.  Or perhaps mod_rewrite collects
them and passes them in to phpscript.php somehow?

You could also consider using:
[^/]* instead of . because, after all, .* does match /, so maybe you
are confusing the Regex so that:
//////////example.video actually matches your pattern, even though you
really don't want it to.

I haven't used mod_rewrite enough to know what pattern system it uses,
so I could be full of [bleep] here.

If all else fails, consider not using mod_rewrite at all, and having a
ForceType on some convenient directory to change that directory into a
PHP script.

For example, suppose you now have:
~/videos/*.video
with a zillion video files in there for the *

mkdir video_files
mv videos/*.video video_files
rmdir videos
cp phpscript.php videos
echo -e "<Files videos>\nForceType application/x-httpd-php\n</Files>"
> .htaccess

Now, your "videos" directory is *REALLY* your phpscript.php, but it
just *looks* like a directory in the URL.

You'd need to change phpscript.php to read the videos (or whatever it
does to them) from "/video_files/" instead of where they are now.

-- 
Like Music?
http://l-i-e.com/artists.htm

-- 
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