Zum Inhalt springen

htaccess & Subdomains

Erstellt am 2. Juni 2005 · 1 Antwort · letzte Antwort am 10. Juni 2005

Tags: Frage

Uhlmann ·

Was für ein htaccess muss ich anlegen damit wenn jemand eine subdomains eintippt sie auf die Hauptdomain gepingt wird?

woida ·

Das wird über die .htaccess nicht möglich sein: Die Datei kommt erst ins spiel, wenn der Nutzer bereits auf einer Domain ist.
Du willst anscheinend eine Catch-All Domain. Die mußt du in deiner Apache-Config einstellen. Sowas in der Richtung:

<virtualhost :80="">
ServerName www.domain.tld
ServerAlias domain.tld *.domain.tld
DocumentRoot /home/www/domain.tld
</virtualhost>

Egal ob der Nutzer xxx.domain.tld oder yyy.domain.tld oder nur domain.tld eingibt, er landet immer in /home/www/domain.tld