Dealing with ~user w/o valid /etc/passwd

Dealing with ~user w/o valid /etc/passwd

Post by Tony Fog » Thu, 22 Jan 1998 04:00:00



I've inherited an NT system running Netscape server and I'm moving all
the web pages to Apache on Solaris.  Thankfully they're both sharing
the same disk space via NFS so I don't actually have to MOVE anything.

Netscape allowed a fake/variable/alternate passwd file (standard unix
format) so that an actual user didn't need to be created on the NT
machine.  Now that I want to move to Apache/Solaris, I want to use
this passwd file to refer to ~username (without actually appending to
my real /etc/passwd).  Failing that, I simply want to rewrite
~username to /user/web/pages/username/public_html BUT hide the rewrite
so that the full path doesn't show up in the browser.  I want the user
to continue seeing http://host/path/~username no matter if they hit
the NT server or the apache (via round robin DNS).

The rewrite rule I'm using is:
RewriteRule   ^/~([^/]+)/?(.*)    /fullpath/$1/public_html/$2  [R]

BUT the browser sees the rewrite as:
http://host/fullpath/username/public_html/ instead of the expected
http://host/~username

This is bad.

Any ideas?

tfogle {at} wans dot net

 
 
 

Dealing with ~user w/o valid /etc/passwd

Post by Dougal Campbel » Thu, 22 Jan 1998 04:00:00


[...details...]

Quote:> The rewrite rule I'm using is:
> RewriteRule   ^/~([^/]+)/?(.*)    /fullpath/$1/public_html/$2  [R]
> BUT the browser sees the rewrite as:
> http://host/fullpath/username/public_html/ instead of the expected
> http://host/~username
> This is bad.
> Any ideas?

Remove the "[R]". You don't want a redirect here. You're just doing a
normal rewrite, which doesn't require redirection.

--

http://www.advicom.net/                 http://advicom.net/~dougal/
           See my homepage for anti-spam information!
QUOTE OF THE MOMENT:
"By the time they had diminished from 50 to 8, the other dwarves began
to suspect 'Hungry' ..."
                -- Gary Larson, "The Far Side"