Forum Moderators: phranque

Message Too Old, No Replies

Redirect domainname to a sub directory on another server

Redirect domainname to a sub directory on another server

         

batigolix

2:16 pm on Sep 20, 2004 (gmt 0)

10+ Year Member




I have an account that both runs aolserver and apache as webservers. the domainnames are being handled by apache. the website runs on aolserver.

I'd like to point a new domain(www.mynewdomain.nl) to a sub directory of the web site on aolserver site [myolddomain.nl:81...]

These are my apache settings:

<VirtualHost 123.456.789>
ServerName www.mynewdomain.nl
ServerAlias www.mynewdomain.nl
ProxyRequests Off
ProxyPass / [myolddomain.nl:81...]
ProxyPassReverse / [myolddomain.nl:81...]
</VirtualHost>

I tried...
ProxyPass [myolddomain.nl:81...]
ProxyPassReverse / [myolddomain.nl:81...]
But it then a lot of links and refernces are being screwed up

I'd like apache to redirect www.mynewdomain.nl to www.mynewdomain.nl/my1stsubsite and in the mean time catch the content from www.myolddomain.nl:81/my1stsubsite/

Can anybody give me a hint in the right direction?

batigolix

9:12 am on Sep 23, 2004 (gmt 0)

10+ Year Member



still trying to redirect
www.mynewdomain.nl
to
www.myolddomain.nl/subdir1
using the virtualhost configuration

i tried rewrite:

<VirtualHost 123.456.789>
ServerName www.mynewdomain.nl
ServerAlias www.mynewdomain.nl
ProxyRequests Off
ProxyPass / [myolddomain.nl:81...]
ProxyPassReverse / [myolddomain.nl:81...]
RewriteEngine on
RewriteRule ^/$ [mynewdomain.nl...]
</VirtualHost>

and redirect:

<VirtualHost 123.456.789>
ServerName www.mynewdomain.nl
ServerAlias www.mynewdomain.nl
ProxyRequests Off
ProxyPass / [myolddomain.nl:81...]
ProxyPassReverse / [myolddomain.nl:81...]
Redirect / [mynewdomain.nl...]
</VirtualHost>

but until now without success.

anybody have a suggestion on how this could be done?

jdMorgan

2:11 pm on Sep 23, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



batigolix,

Welcome to WebmasterWorld!

Both of your redirection methods contain minor syntax errors that will prevent them from working properly.


RewriteRule ^/$ http://www.mynewdomain.nl/subdir1
Redirect / http://www.mynewdomain.nl/subdir1

should be

RewriteRule ^/[b](.*)[/b]$ http://www.mynewdomain.nl/subdir1[b]/$1 [R=301,L][/b]
RedirectPermanent / http://www.mynewdomain.nl/subdir1[b]/[/b]

The bolded parts of the the RewriteRule are necessary to redirect all page requests to the new domain, and the Redirect was missing a slash.

Proxy applications can be very complex, and as a result, few members here feel comfortable making suggestions. I'm not even sure that these corrections will do what you want to do. See the Apache documentation of mod_alias and mod_rewrite for more information.

Jim

batigolix

9:52 am on Sep 24, 2004 (gmt 0)

10+ Year Member



thanks jim.

i tried both and there they don't make no difference

it is quite complicated even to explain what the exact problem is.