我对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>
zoziology
<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
/etc/apache2/sites-enables
sudo a2ensite amelineandraphael
和sudo a2ensite zoziologie
子域zoziologie.raphaelnussbaumer.com正在运行,但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
有什么想法吗?
答案 0 :(得分:1)
我想我找到了解决方案。虽然我不确定这是解决方案的唯一部分:
sudo a2dissite 000-default
答案 1 :(得分:0)
不幸的是我还没有评论,因为我没有代表,所以很抱歉这是一个“答案”。
我想知道你是否有该子域的DNS“A”记录?您可能有一个通配符DNS记录,这将使这成为一个有争议的点