This is a discussion on mod_rewrite problems in Apache 1.3.x within the Linux Web Servers forums, part of the Web Server and Related Forums category; Greetings. I'm stumped by a "it used to work..." problem on Apache 1.3.29 (although it ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
Greetings.
I'm stumped by a "it used to work..." problem on Apache 1.3.29 (although it doesn't appear to be important, this is on FreeBSD 4.8-STABLE, but also occurs on Apache 1.3.28 on Linux w/ kernel 2.4.22). This worked fine, apparently, in 4.6-STABLE, which had (i think) Apache 1.3.24. So, the problem: when i request http://127.0.0.3/foo.html, i get redirected to http://127.0.0.3//bar/index.php (note the // between the path and domain). I'd hoped to get a redirect to http://127.0.0.3/bar/index.php (see the .htaccess RewriteRule below). Anyway, the .htaccess in my top-level directory has this (these are on my local Linux box, FWIW): -snip- RewriteEngine on RewriteBase / RewriteRule ^foo\.html$ bar/index.php [R] -snip- And here's the relevant virtual host config: -snip- <VirtualHost 127.0.0.3> DocumentRoot /home/scott/nut_design/ybh ScriptAlias /cgi-bin/ /home/scott/nut_design/ybh/cgi-bin/ ServerName 127.0.0.3 ErrorLog /var/log/httpd/ybh_test-error_log RewriteEngine On RewriteOptions inherit RewriteLog /var/log/httpd/ybh_test-rewrite_log RewriteLogLevel 3 <Directory "/"> order allow,deny Allow from all AllowOverride FileInfo Options Indexes Options FollowSymLinks </Directory> </VirtualHost> -snip- I turned on RewriteLog, and can see it happening (sorry if the wrapping makes it too weird): -snip- 127.0.0.3 - - [06/Jan/2004:13:31:24 -0500] [127.0.0.3/sid#808a220][rid#808f870/initial] (2) [per-dir /home/scott/nut_design/ybh/] explicitly forcing redirect with http://127.0.0.3/home/scott/nut_desi.../bar/index.php 127.0.0.3 - - [06/Jan/2004:13:31:24 -0500] [127.0.0.3/sid#808a220][rid#808f870/initial] (2) [per-dir /home/scott/nut_design/ybh/] trying to replace prefix /home/scott/nut_design/ybh/ with / 127.0.0.3 - - [06/Jan/2004:13:31:24 -0500] [127.0.0.3/sid#808a220][rid#808f870/initial] (1) [per-dir /home/scott/nut_design/ybh/] escaping http://127.0.0.3//bar/index.php for redirect -snip- It works fine with .htaccess files in subdirectories. I've tried to figure out a way to simply rewrite the // to /, but keep getting stymied. Of course the ideal solution would be to simply keep this from getting messed-up in the first place! Help? Dope-slaps are fine, if I deserve it! Thanks, -s. -- Scott Hepler System Administration and Security Web Development (802) 457-3796 |
| Thread Tools | |
| Display Modes | |
|
|