View Full Version : Domain name to domain + /path/

07 Oct 2010, 02:38 AM
Does anyone have any experience regarding this?

Say you want to point the following domains in this way:

Exempel.se => exempel.se/index.php/sv/hem

Exempel.dk => exempel.dk/index.php/da/forside

Uk.exempel.dk => uk.exempel.dk/index.php/uk/home

I know how to do redirects via IIS or php/asp files.

But when it comes to redirecting from the same domain to domain + /path/ I'm a little lost.

All three domains point to the same IIS web folder, the site is a multi-language Joomla site.

Thanks for looking into it.

11 Oct 2010, 12:17 PM
You would have to do it using Rewrite Rules.
I think in IIS the way that you would have to do it would be to create three different sites pointing to different home directories. All three of them mounted with the same IP addresses and you would use Host Header Values to determine which site contect should be used.

In Apache you would use something like the following using mod_rewrite:

RewriteCond %{HTTP_HOST} ^exemple\.se [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://exemple.se/index.php/sv/hem/$1 [L,R]

RewriteCond %{HTTP_HOST} ^exemple\.dk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://exemple.dk/index.php/da/forside/$1 [L,R]

RewriteCond %{HTTP_HOST} ^uk\.exemple\.dk [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://uk.exemple.dk/index.php/uk/home/$1 [L,R]