Proxy Solution

Using a single web hosting account to host multiple sites

Proxy Solution

Postby david64 » Mon Sep 08, 2008 4:06 pm

Hi. I am not sure if this is the most relevant place to post this, but here goes.

I have just got a new hosting account, which lets me set up multiple "partitions". Each partition has its own IP address, root directory and database. Unfortunately, I want all my domains to point at one directory on one of the partitions, but the host only allows me to point domains to directories within its partition.

I can't just straight .htaccess them because I need the actual domain to be preserved in the environmental variables.

For example, I could do this:

^domaina.com/\.*$ domainb.com?=$1

This would point domaina.com to my centralised files on domainb.com, but SERVER_NAME will now think I am on domainb.com and would load the relevant data for domainb.com when I want it to load domaina.com data.

I know there is a proxy option [P] in mod_rewrite/apache. Will something like that keep the SERVER_NAME variable as domaina.com?

If that's not clear, I'll try and recap summarise. I have files that can be accessed at domainb.com, but if I forward all URLs of domaina.com to domainb.com, the server will just think domainb.com is accessing the files. I just need to preserve the SERVER_NAME var when doing a redirect, so my script knows which files to load.
david64
 
Posts: 15
Joined: Wed Mar 26, 2008 2:16 pm

Postby richardk » Wed Sep 10, 2008 10:10 am

The proxying would show domainb's variables, it's like a whole new request from your browser.

What are the document roots like? Can you create Symbolic Links?
richardk
 
Posts: 8800
Joined: Wed Dec 21, 2005 7:50 am

Postby david64 » Mon Sep 29, 2008 6:05 pm

No. Unfortunately not. I've ended up using the cURL library to just pull the html result across servers.
david64
 
Posts: 15
Joined: Wed Mar 26, 2008 2:16 pm


Return to Domain Handling

Who is online

Users browsing this forum: Google [Bot] and 20 guests

cron