Subdomain redirect

Using a single web hosting account to host multiple sites

Subdomain redirect

Postby brightstaronline » Sat Feb 17, 2007 6:06 pm

Hi,

Sorry if this has already been asked but I honestly can't find it using search...

I want to do the following if it is possible:

When a user goes to http://subdomain.domain.com (with or without "www") for it to load otherdomain.com/data but still keep subdomain.domain.com in the address bar.

subdomain.domain.com >> otherdomain.com/data but with subdomain.domain.com in the address bar - is this possible?

Any help appreciated.

I have this so far:

RewriteEngine on
rewritecond %{REQUEST_URI} http://subdomain.domain.com/
rewritecond %{REQUEST_URI} http://www.subdomain.domain.com/
rewriterule (.*) http://otherdomain.com/data/$1 [l,nc]

But otherdomain.com/data appears in the address bar.
brightstaronline
 
Posts: 4
Joined: Sat Feb 17, 2007 5:57 pm

Postby richardk » Sun Feb 18, 2007 6:44 am

You need mod_proxy enabled (for P) as well as mod_rewrite:
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} ^(www\.)?sub\.domain\.com$ [NC]
RewriteRule ^(.*)$ http://otherdomain.com/data/$1 [P,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby brightstaronline » Sun Feb 18, 2007 7:22 am

Thank you for your quick reply, can you tell me or send me to a site that will tell me how to enable mod_proxy.

Thanks in advance.
brightstaronline
 
Posts: 4
Joined: Sat Feb 17, 2007 5:57 pm

Postby richardk » Sun Feb 18, 2007 7:47 am

If you have access to the httpd.conf file you need to uncomment (remove the # from the beginning of) the LoadModule line for mod_proxy (near the top of the file probably).

If you don't have access to the httpd.conf file you will need to ask your host.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby brightstaronline » Sun Feb 18, 2007 9:52 am

It wasn't in there, tried installing following instructions on Apache website for mod_proxy.c and adding it to conf file but have given up.

Thanks anyway.
brightstaronline
 
Posts: 4
Joined: Sat Feb 17, 2007 5:57 pm

Postby richardk » Sun Feb 18, 2007 2:47 pm

Do you have other .conf files? It might be in one of those.
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby brightstaronline » Sun Feb 18, 2007 2:48 pm

OK thanks, I'll check.
brightstaronline
 
Posts: 4
Joined: Sat Feb 17, 2007 5:57 pm


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 29 guests

cron