XHTMLforum

XHTMLforum (http://xhtmlforum.de/index.php)
-   Serveradministration und serverseitige Scripte (http://xhtmlforum.de/forumdisplay.php?f=80)
-   -   htaccess-Datei Umleitung mehrerer Domains (http://xhtmlforum.de/showthread.php?t=73213)

fabske 18.04.2017 14:59

htaccess-Datei Umleitung mehrerer Domains
 
Hallo Leute,

ich stehe vor der Herausforderung eine .htaccess Datei zu erstellen, die folgendes macht:

1. Anfragen an http://www.hauptdomain.com an https://www.hauptdomain.com
2. Anfragen an http://hauptdomain.com an https://www.hauptdomain.com
3. Anfragen an http://www.hauptdomain.de an https://www.hauptdomain.com
4. Anfragen an http://hauptdomain.de an https://www.hauptdomain.com
5. Anfragen von http://www.nebendomain1.com an https://www.hauptdomain.com
6. Anfragen von http://nebendomain1.com an https://www.hauptdomain.com
7. Anfragen von http://www.nebendomain1.de an
https://www.hauptdomain.com
8. Anfragen von http://nebendomain1.de an https://www.hauptdomain.com

Sprich: ich habe mehrere Domains und möchte dass alle Anfragen an diese Domains, mit oder ohne www, immer auf der https://www.hautpdomain.com laden.

Dazu habe ich beim Registrar entsprechend alle A-Pointer gesetzt. Nun brauche ich nur noch die .htaccess Datei aber alle meine Versuche sind bislang fehlgeschlagen.

Kann mir jemand helfen?

protonenbeschleuniger 18.04.2017 18:53

Welche Versuche?

(Und du solltest wenn du die Links im Text umwandeln läßt, z.b. example.org verwenden https://www.iana.org/domains/reserved so sind das ein dutzend toter Links und eine die etwas schwer erreichbar ist)

fabske 19.04.2017 11:52

Also ich habe das hier gebaut, aber es funktioniert nur teilweise:

Code:

RewriteCond %{HTTP_HOST} ^(.*)hauptdomain.com [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.hauptdomain.com/$1 [R=301,L]

RewriteCond %{HTTP_HOST} ^(.*)hauptdomain.de [NC]
RewriteRule ^(.*)$ https://www.hauptdomain.com/$1 [R=301,L]

Obwohl ich es erwarte, wird mit dieser .htaccess leider nicht von http://hauptdomain.com auf https://www.hauptdomain.com weitergeleitet.

(Sorry, aber zum Verständnis habe ich nun die domains belassen.)

protonenbeschleuniger 19.04.2017 17:11

Sollte es tun. Was passiert denn?


Alle Zeitangaben in WEZ +2. Es ist jetzt 15:55 Uhr.

Powered by vBulletin® Version 3.8.11 (Deutsch)
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

© Dirk H. 2003 - 2023