Forcing correct domain URL (of 4) display for each subfolder

Using a single web hosting account to host multiple sites

Forcing correct domain URL (of 4) display for each subfolder

Postby marcusjurgen » Tue Mar 13, 2007 1:58 pm

Hi folks,

hope someone can help... have recently moved servers and suddenly htaccess file doesn't work as it used to...

Have 4 domains;
1. ggg.eu
2. mmm.eu
3. ppp.eu
4. rrr.ie

And 4 subfolders on server...
1. eu_gg
2. eu_mm
3. eu_pp
4. eu_rr

The 4 domains are allocated for different sites - with each a slightly different interface - which all follow the same structure and have a header bar to switch inbetween the sites.

Basically what I'd like to happen is that when a user is e.g. at
http://www.ggg.eu/eu_gg/community/news.php

and wants click on a link to the folder
../../eu_mm/community/news.php

that then the URL in the browser address bar automatically adapts to
http://www.mmm.eu/eu_mm/community/news.php
instead of
http://www.ggg.eu/eu_mm/community/news.php

With the old host all was working fine, but since opening up the 4th domain with a different host and pointing the DNSs of the other 3 domains to the server of the 4th domain (with a different provider), it all doesn't work any longer.

Is there any step I have forgotten, or done something wrong?
Or do all domains need to be hosted with the same provider in order for this to work?

The HTaccess script that used is work is like this in each of the 4 subfolders:


Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} .
RewriteCond %{HTTP_HOST} !^ggg\.eu
RewriteRule (.*)$ http://ggg.eu/eu_gg/$1 [R=permanent,L]
marcusjurgen
 
Posts: 1
Joined: Tue Mar 13, 2007 1:44 pm

Postby richardk » Wed Mar 14, 2007 8:45 am

As long as the requests are getting to the web server DNS is not the problem. Are you sure you are able to use mod_rewrite? Test for it, or ask your host.

You could try this in a .htaccess file in your document root (no other .htaccess files are needed)
Code: Select all
Options +FollowSymLinks

RewriteEngine On

RewriteCond %{HTTP_HOST} !^((www\.)?ggg\.eu)?$ [NC]
RewriteRule ^(eu_gg(/.*)?)$ http://www.ggg.eu/$1 [R=301,L]

RewriteCond %{HTTP_HOST} !^((www\.)?mmm\.eu)?$ [NC]
RewriteRule ^(eu_mm(/.*)?)$ http://www.mmm.eu/$1 [R=301,L]

# etc..
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