mod_rewrite problems in Apache 1.3.x

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


Go Back   Usenet Forums > Web Server and Related Forums > Linux Web Servers

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 01-06-2004
Scott Hepler
 
Posts: n/a
Default mod_rewrite problems in Apache 1.3.x

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

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 05:11 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0