RE: URL forwarding
Hi,
On Thu, 17 Oct 2002, Price, Erik wrote:
<snip>
>
> (sorry my mail client is such a piece of shit)
>
heh, seems it does not support the 72 char linewrap either ;-)
> Does your host provide for the use of .htaccess files, and if so, is
> mod_rewrite URL-rewriting a feature that is supported? This is
> something that is specified in the httpd.conf file, usually. Read up on
> .htaccess files at http://httpd.apache.org/ and then make sure that your
> host is configured to let you use them. Or just ask the webmaster.
>
Yes, I found out it was disabled. After I enabled it I got to play with it
:^).
> Also, I think that your RewriteBase directive should specify an absolute
> filesystem path, not a URI. But I can't remember if it's an absolute
> filesystem path according to the server's filesystem or according to
> document root. So I would try:
>
> RewriteEngine On
> RewriteBase /var/www/
> RewriteRule ^(.+) /home/~mypage/ [R]
>
Doesn't work since ~mypage is not on my server, but on my ISP's. In fact,
I do not have any webpages on my server (too slow in upload), so that is
why I want to redirect them all.
> It might not work, but experiment with those paths -- mod_rewrite is a
> bitch and I haven't yet mastered it myself.
>
I found a link to the syntaxis of the rewrite module and I got it working
now! Add this to httpd.conf:
RewriteEngine on
RewriteRule ^/(.*) http://www.myweb.com/~mypage/$1 [R]
and every query made to http://www.mydomain.com/whatever.ext is nicely
redirected to http://www.myweb.com/~mypage/whatever.ext ;-)
Most important step done, but now my next question:
After I typed http://www.mydomain.com/ in my browser, the URI line also
changes to http://www.myweb.com/~mypage/. Is there a trick so that the
browser will keep displaying http://www.mydomain.com/ in the URI?
Thanks again!
Sebastiaan
>
>
>
> Erik
>
Reply to: