Go Back   CodingForums.com > :: Server side development > Other server side languages/ issues

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2002, 11:14 PM   PM User | #1
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
how to seamlessly integrate multiple domains

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?
brothercake is offline   Reply With Quote
Old 09-06-2002, 07:06 AM   PM User | #2
Spookster
Supreme Overlord


 
Spookster's Avatar
 
Join Date: May 2002
Location: Marion, IA USA
Posts: 6,220
Thanks: 4
Thanked 80 Times in 79 Posts
Spookster will become famous soon enough
Does your host give you domain pointers as a part of your package?
__________________
Spookster
CodingForums Supreme Overlord
All Hail Spookster
Who gave you that Ugging infraction? Yeah that's right it was me!
Spookster is offline   Reply With Quote
Old 09-06-2002, 09:59 AM   PM User | #3
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
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/
MCookie is offline   Reply With Quote
Old 09-06-2002, 02:26 PM   PM User | #4
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
Quote:
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?
brothercake is offline   Reply With Quote
Old 09-06-2002, 07:10 PM   PM User | #5
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
Quote:
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.
MCookie is offline   Reply With Quote
Old 09-06-2002, 07:54 PM   PM User | #6
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
But how is that acheived unless your two domain names are initially pointing at two different IP addresses?
brothercake is offline   Reply With Quote
Old 09-07-2002, 12:50 PM   PM User | #7
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
Quote:
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

Quote:
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.
MCookie is offline   Reply With Quote
Old 09-07-2002, 07:01 PM   PM User | #8
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
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?
brothercake is offline   Reply With Quote
Old 09-09-2002, 08:54 AM   PM User | #9
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
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?
MCookie is offline   Reply With Quote
Old 09-09-2002, 08:03 PM   PM User | #10
brothercake
Senior Coder


 
Join Date: Jun 2002
Location: near Oswestry
Posts: 4,508
Thanks: 0
Thanked 0 Times in 0 Posts
brothercake is an unknown quantity at this point
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
brothercake is offline   Reply With Quote
Old 09-10-2002, 08:32 AM   PM User | #11
MCookie
Regular Coder

 
Join Date: Jun 2002
Location: NL
Posts: 421
Thanks: 0
Thanked 0 Times in 0 Posts
MCookie is an unknown quantity at this point
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.
MCookie is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 08:49 AM.


Advertisement
Log in to turn off these ads.