子域不工作

Sub-domain not working

我是 apache 的新手,所以解决方案对您来说可能很明显...我 运行正在使用 Debian wheezy

这是我在 /etc/apache2/sites-availables 中的两个文件:

amelineandraphael

<VirtualHost *:80>
        ServerAdmin webmaster@localhost
        ServerName amelineandraphael.raphaelnussbaumer.com

        DocumentRoot /var/www/amelineandraphael
        <Directory />
                Options FollowSymLinks
                AllowOverride None
        </Directory>
        <Directory /var/www/amelineandraphael>
                Options Indexes FollowSymLinks MultiViews
                AllowOverride All
                Order allow,deny
                allow from all
        </Directory>

        ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
        <Directory "/usr/lib/cgi-bin">
                AllowOverride None
                Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
                Order allow,deny
                Allow from all
        </Directory>

        ErrorLog ${APACHE_LOG_DIR}/error.log

        # Possible values include: debug, info, notice, warn, error, crit,
        # alert, emerg.
        LogLevel warn

        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>

动物学

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    ServerName zoziologie.raphaelnussbaumer.com

    DocumentRoot /var/www/zoziologie
    <Directory />
            Options FollowSymLinks
            AllowOverride None
    </Directory>
    <Directory /var/www/zoziologie>
            Options Indexes FollowSymLinks MultiViews
            AllowOverride All
            Order allow,deny
            allow from all
    </Directory>

    ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
    <Directory "/usr/lib/cgi-bin">
            AllowOverride None
            Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
            Order allow,deny
            Allow from all
    </Directory>

    ErrorLog ${APACHE_LOG_DIR}/error.log

    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    LogLevel warn

    CustomLog ${APACHE_LOG_DIR}/access.log combined

子域 zoziologie.raphaelnussbaumer.com is working but amelineandraphael.raphaelnussbaumer.com 将我重定向到位于 /var/www/ 的默认 index.html。

这里是 /var/www/amelineandraphael 的 .htaccess:

SetEnv PHP_VER 5_4

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

有什么想法吗?

不幸的是我还不能发表评论,因为我没有代表,很抱歉这是 "answer"。

我想知道您是否有该子域的 DNS "A" 记录?不过,您可能有一个通配符 DNS 记录,这将成为一个有争议的问题

我想我找到了解决办法。虽然我不确定这是解决方案的唯一部分:

sudo a2dissite 000-default