Geert
Geert

Reputation: 805

How to have 2 domains on the same website?

For a client we have setup a multilanguage website that consists of an English and Dutch part. The urls look like:

www.example.com for the english website and www.example.com/nl/ for the dutch website

However, I want to change this www.example.comto www.example.nl instead of www.example.com/nl/

How to get this? We already have setup that both domains (example.com and example.nl) point to the same root. But we not yet able to have the /nl/ extension point to example.nl

Hope someone can help me.

Upvotes: 0

Views: 113

Answers (3)

sarnold
sarnold

Reputation: 104060

I've not tried this, but I believe the Move Homedirs to Different Webserver example is a good fit for this problem. First, the example:

On the old webserver we just redirect all /~user/anypath URLs to http://newserver/~user/anypath.

  RewriteEngine on
  RewriteRule   ^/~(.+)  http://newserver/~$1  [R,L]

And my thought on how this would work for you:

RewriteEngine on
RewriteRule   ^/nl/(.+)  http://newserver.nl/1  [R,L]

Upvotes: -1

Roman Newaza
Roman Newaza

Reputation: 11690

Just define two virtual hosts with different DocumentRoot. Apache Core Features / DocumentRoot Directive

Upvotes: 2

Fabian
Fabian

Reputation: 3495

You will need to set the /nl/ directory as root for your .nl Domain.

Upvotes: 1

Related Questions