Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 11 of 11
  1. #1
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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?

  • #2
    Supreme Overlord Spookster's Avatar
    Join Date
    May 2002
    Location
    Marion, IA USA
    Posts
    6,278
    Thanks
    4
    Thanked 83 Times in 82 Posts
    Does your host give you domain pointers as a part of your package?
    Spookster
    CodingForums Supreme Overlord
    All Hail Spookster

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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/

  • #4
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #6
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    But how is that acheived unless your two domain names are initially pointing at two different IP addresses?

  • #7
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #8
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #9
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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?

  • #10
    Senior Coder
    Join Date
    Jun 2002
    Location
    near Oswestry
    Posts
    4,508
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #11
    Regular Coder
    Join Date
    Jun 2002
    Location
    NL
    Posts
    421
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •