pointing from one domain to another

Using a single web hosting account to host multiple sites

pointing from one domain to another

Postby river_jetties » Tue Apr 10, 2007 2:21 pm

I have a url:
http://www.domain.com/blogs/

and want it to bring data in from:
http://blogs.domain.com/

but not use a redirect because we want to be able to pull xml files via Javascript from blogs.domain.com from the main site. Would mod_proxy help me here? I would rather we could just do it via mod_rewrite or just have a .php file that proxies everythign beneath that (although this could be slow).

The blogs.domain.com is physically hosted on a seperate server.

any ideas on how to do this with mod_rewrite?

thanks,

jonathan
river_jetties
 
Posts: 1
Joined: Tue Apr 10, 2007 2:17 pm

Postby richardk » Tue Apr 10, 2007 2:33 pm

Mod_rewrite would need to use mod_proxy (the P flag) to get the data from the other server. In a .htaccess file in your document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^blogs(/(.*))?$ http://blogs.domain.com/$2 [NC,P,L]


Or if you have access to the httpd.conf file it would be better to user mod_proxy directly.

To use a PHP file, in a .htaccess file in your document root
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteRule ^blogs(/(.*))?$ /blogs-proxy.php?request_path=/$2 [NC,QSA,L]
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am


Return to Domain Handling

Who is online

Users browsing this forum: No registered users and 39 guests

cron