1. Startseite
  2. Web-Inhalt
  3. Subdomain-Fall-Through-Verhalten

Subdomain-Fall-Through-Verhalten

Übersicht

Subdomains created within the control panel via WebSubdomains will map to corresponding document roots. Subdomains not explicitly defined under Web > Subdomains, called a fall-through, will always serve content from your primary domain located under /var/www/html.

Beispiel: assume web.mydomain.com maps to /var/www/web, und mydomain.com is the main domain that serves content from /var/www/html. “web” is the only subdomain associated with the account.

  • http://web.mydomain.com will serve content from /var/www/web
  • http://www.web.mydomain.com will serve content from /var/www/web
  • http://mydomain.com serves content from /var/www/html
  • http://weeb.mydomain.com or http://adkjsdhfksaewfiujohewiuiu3b4iubfuidjnkv.mydomain.com will serve content from /var/www/html (fall-through behavior)

Lösung

To stop this behavior, create a .htaccess file under /var/www/html with the following lines:

RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www.)?mydomain.com [NC]
RewriteRule .* - [R=404,L]

Substitute mydomain.com with your actual domain name.

Aktualisiert am März 7, 2021

Verwandte Artikel