...

View Full Version : how to seamlessly integrate multiple domains



brothercake
09-05-2002, 11:14 PM
For example - I have

www.britain.com

and

www.ireland.ie


and at the moment, they both point to the same IP address. What I want to do is intercept URL requests such that

www.ireland.ie/information.html

is redirected to

www.britain.com/international/information.html



I was initially thinking to use mod_rewrite or mod_alias to do it, but they only seem to be able to affect the internal file addresses, rather than being able to modify the entire url.

any thoughts?

Spookster
09-06-2002, 07:06 AM
Does your host give you domain pointers as a part of your package?

MCookie
09-06-2002, 09:59 AM
Did you try a simple redirect? Or are your domains not at the same host? I just tested this:
In domain.nl which is pointing to domain.com I've put a .htaccess with this redirect in it:

Redirect /folder/ http://www.domain.com/folder/otherfolder/

So when I asked for domain.nl/folder/ I was seamless redirected to domain.com/folder/otherfolder/

brothercake
09-06-2002, 02:26 PM
Originally posted by MCookie
Did you try a simple redirect? Or are your domains not at the same host? I just tested this:
In domain.nl which is pointing to domain.com I've put a .htaccess with this redirect in it:

Redirect /folder/ http://www.domain.com/folder/otherfolder/

So when I asked for domain.nl/folder/ I was seamless redirected to domain.com/folder/otherfolder/

But that wouldn't be able to discriminate - so requests for domain.com/folder would also be redirected to domain.com/folder/otherfolder - that was the issue, that those techniques can't query the whole URL, only the bit after the root.


Spookster - the host doesn't give us much; when I asked my tech support contact how this could be done, he didn't know and pointed me to the apache documentation for Redirect commands. Not ideal really ... I don't usually expect a webhost to say "work it out yourself" ... makes me wonder why we're using them at all ...

Anyway . in the meantime - what are "domain pointers" - is it someting I can set up myself?

MCookie
09-06-2002, 07:10 PM
Originally posted by brothercake
- so requests for domain.com/folder would also be redirected to domain.com/folder/otherfolder -
Well, no, with the .htaccess at domain.nl, only domain.nl/folder/ will be redirected, but domain.com/folder/ won't.

brothercake
09-06-2002, 07:54 PM
But how is that acheived unless your two domain names are initially pointing at two different IP addresses?

MCookie
09-07-2002, 12:50 PM
But how is that acheived unless your two domain names are initially pointing at two different IP addresses?

Those domain names are pointing to the same IP. But that doesn't matter. It only means that requests for domain.nl/ are redirected to domain.com/. Root level.
As long as you can use a .htaccess at the first domain, you can redirect every possible url request to any other folder or file at any other domain on the net.

When at domain ireland.ie the .htaccess says:
Redirect /information.html http://www.britain.com/international/information.html every request for http://www.ireland.ie/information.html will be redirected to http://www.britain.com/international/information.html


But that wouldn't be able to discriminate - so requests for domain.com/folder would also be redirected to domain.com/folder/otherfolder - that was the issue, that those techniques can't query the whole URL, only the bit after the root.

If you would use this at ireland.ie:
Redirect /information/ http://www.britain.com/international/ you would redirect every request for any file in www.ireland.ie/information/ to www.britain.com/international/. You can't discriminate, but on a file level every redirect is possible. The only condition is the possibility to use a .htaccess at the domain wherefrom you want to redirect.

brothercake
09-07-2002, 07:01 PM
I'm probably being really stupid here ... but i still don't grock this.

Both domains point to the same IP address - domain.com and domain.ie are the same root folder on the same server. How does the .htaccess know which domain name you asked for?

MCookie
09-09-2002, 08:54 AM
Domain.com and domain.ie are the same root folder? Never thought of that. But that's where your redirecting ends, I think.
In my case, the .nl domain is a second folder at the root of .com. I don't know why they they did that. We only wanted to redirect users typing in domain.nl by mistake to redirect to domain.com/. So domain.nl/ points to domain.com/ but I can put .htaccesses in both.

If you can't do that I don't know how to redirect or rewrite. As you said in your first post redirecting or rewriting absolute URLs is not possible.
But then (now it's me being stupid), since you can't use the domain.ie/ for anything else but redirecting to domain.com/, why would users request a page domain.ie/information.html if such page never existed or even could exist in the first place?

brothercake
09-09-2002, 08:03 PM
Ah well .. that's kind of the whole problem. It never used to be like this - it used to be that those pages were on a completely different server, run by different people for a different company.

But my company is a bit like the Borg (except without the Evil) - it buys out smaller companies in order to extend the range of international services we can offer, and we're in the process of assimilating their websites into our own.

So the deeplinks are out there already, and I don't want them to break.

Ah well; i'm looking into the DocumentRoot directive now, to see if that can help (if I can persuade our host to turn it on ...)


Thanks for all your help with this

MCookie
09-10-2002, 08:32 AM
Looks really complicated. I was wondering if the request for domain.ie/information.html actually ever reaches your .com server? Somewhere in between there's the DNS record for domain.ie and that is pointing the request for .ie to domain.com. So maybe your server never even sees the .ie extension, in which case there's just nothing you can do. You'd need Borg technology...
Maybe moving to another host is best then. One that puts a folder in your root for every domain that points to your .com. I thought that's sort of common thing to do.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum