The necessary basics:
Windows 98 (1st ed)
Apache 1.3.24
PHP 4.2.1 (Apache module)
I have these lines in my .htaccess file:
RewriteEngine On
RewriteRule dbimage/(.)/(.).jpg$ images/image.php?width=$1\&image_id=$2
This in my httpd.conf file: (to get the juicy details)
RewriteLog logs/rewrite.log
RewriteLogLevel 9
The problem:
when I load this URL: http://localhost/dbimage/100/1.jpg
I get a "400 Bad Request" error. The mod_rewrite should convert that url to: http://localhost/images/image.php?width=100&image_id=1
My observations:
Looking into my handy "rewrite.log" file, I find these lines (irrelevent beginnings of lines removed):
(3) [per-dir c:/www/mcsda/] add path-info postfix: c:/www/mcsda/dbimage -> c:/www/mcsda/dbimage/100/1.jpg
(3) [per-dir c:/www/mcsda/] strip per-dir prefix: c:/www/mcsda/dbimage/100/1.jpg -> dbimage/100/1.jpg
(3) [per-dir c:/www/mcsda/] applying pattern 'dbimage/(.)/(.).jpg$' to uri 'dbimage/100/1.jpg'
(2) [per-dir c:/www/mcsda/] rewrite dbimage/100/1.jpg -> images/image.php?width=100&image_id=1
(3) split uri=images/image.php?width=100&image_id=1 -> uri=images/image.php, args=width=100&image_id=1
(3) [per-dir c:/www/mcsda/] add per-dir prefix: images/image.php -> c:/www/mcsda/images/image.php
(3) [per-dir c:/www/mcsda/] add per-dir prefix: c:/www/mcsda/images/image.php -> c:/www/mcsda/c:/www/mcsda/images/image.php
For some strange reason, the "add per-dir prefix" step happens twice. That seems to be where the trouble is, though I am clueless on how to fix it.
Thanks for your help!