RE: URL forwarding
Hi,
On Thu, 17 Oct 2002, Price, Erik wrote:
>
>
> > -----Original Message-----
> > From: Sebastiaan [mailto:S.Breedveld@ITS.TUDelft.NL]
> > Sent: Thursday, October 17, 2002 7:46 AM
> > To: Price, Erik
> > Cc: Sebastiaan; debian-user@lists.debian.org
> > Subject: RE: URL forwarding
> > > > > Hey, looks like the stuff I need. Unfortunetely I am unable
> > > > to configure
> > > > it correctly. I am stranded at:
> > > >
> > > > RewriteEngine on
> > > > RewriteBase %{REQUEST_URI}
> > > > RewriteRule ^(.+) http://www.myweb.com/~mypage/$1
> > > >
> > > > but after a apachectl configtest, it complains about:
> > > > RewriteBase: only valid in per-directory config files
> > > >
> > > > Any idea how to translate www.mydomain.com to
> > www.myweb.com/~mypage ?
> > >
> > >
> > >
> > > Doesn't that mean that you need to use it in a /.htaccess
> > file? Are you modifying httpd.conf or a .htaccess file?
> > >
> > I am modifying httpd.conf. So you mean I should add the three
> > lines above
> > in the .htaccess?
>
> Yes, the error message you got ("RewriteBase: only valid in
> per-directory config files") is referring to .htaccess file. Put the
> rule in a .htaccess file and put that file in the docroot of the virtual
> host.
>
Thanks, but I still can't get it to work. On the server www.mydomain.com
I have put
RewriteEngine on
RewriteBase http://www.mydomain.com/
RewriteRule ^(.+) http://www.myweb.com/~mypage/$1
in the /var/www/.htaccess directory, which is empty except that one file.
Unfortunately when I browse to http://www.mydomain.com/ it ends up showing
the empty directory /var/www/. Looks like apache does not care about the
.htaccess file, or I configured it wrong.
Thanks,
Sebastiaan
ps: I do not have any special access to www.myweb.com
>
> Erik
>
Reply to: