complex rewrite help
Posted by: miscdebris
Posted on: 2003-11-21 10:11:00
Hello all. I'm having a difficult time figuring out how to resolve this issue and thought maybe someone here could help...
I'm using a php-cgi script that is a PHP front-end to ImageMagick so that I can manipulate images on the fly. I have to use php-cgi because the script uses an exec() function. Problem is, the script requires extra path information to be passed to it from the URL string, and that is something php-cgi doesn't like. It works fine with normal PHP.
The script normally works with a URL like this:
.../pics/magick.php/123456.jpg?resize(128x128)
OR:
.../pics/magick.php/$id.jpg?resize(128x128)
where $id is a variable that points to a unique image ID number. and the "resize..." information gets passed to the script for processing by ImageMagick. But as soon as the URL is changed to:
.../pics/magick.pcgi/12345.jpg?resize(128x128)
the script chokes because the URL string can't be parsed correctly by the php-cgi.
Can this issue be solved with mod_rewrite? I'm not sure how, so if you can give me any pointers, I'd really appreciate it.
Thanks.
tim