Mehrere Domains ein Ziel

Post non-phpwcms related topics here - but I don't want to see "hey check this or that other cms". Post if you have a point or worthwhile comment, don't post just to increase you post count!
Post Reply
phalancs
Posts: 793
Joined: Thu 19. Feb 2004, 05:09
Location: Germany

Mehrere Domains ein Ziel

Post by phalancs »

Irgendwie hab cih das Gefühl ich übersehe etwas ganz simples. Aber ich habe grad folgendes Problem:

Mehrere Domains sollen auf die gleiche Seite verweisen.
- Dabei jedoch keinen duplicate Content produzieren.
- Das Ziel in einer identischen Syntax aufrufen.

Beispiel:
- example.de
- example.com

sollen immer zu www.example.com weiterleiten.

Dabei soll idealerweise auch der Querystring mitgesendet werden. Also wenn ich example.de/folder eingeben soll zu www.example.com/folder geleitet werden.

Da ich irgendwie das Gefühl habe das das ganze mit htaccess sauberer zu realisieren ist, würde ich es damit gerne erledigen. Wie macht ihr das?
2008
User avatar
update
Moderator
Posts: 6455
Joined: Mon 10. Jan 2005, 17:29
Location: germany / outdoor

Re: Mehrere Domains ein Ziel

Post by update »

mit der .htaccess im Regelfall
It's mostly all about maintaining two or three customer's sites Still supporter for the band Mykket Morton. Visit Mykket Morton on FB. Listen Mykket Morton and live videos on youtube.
Now building a venue for young artists to get wet on stage, rehearsal rooms, a studio, a guitar shop - yes I'm going to build some guitars.
nameless1
Posts: 878
Joined: Sun 27. Apr 2008, 23:22

Re: Mehrere Domains ein Ziel

Post by nameless1 »

Code: Select all

RewriteCond %{HTTP_HOST} !^www.example.com$
RewriteRule ^ http://www.example.com/%{REQUEST_URI} [L,R=301]
Post Reply