2012-12-21 47 views
0

我有2台虚拟主机是这样的:Apache的mod_rewrite的,的.htaccess和虚拟主机冲突

<VirtualHost *:80> 
DocumentRoot /var/www/html/watermelon/hhgt/webroot 
ServerName booking 
#ErrorLog logs/booking-error_log 
#CustomLog logs/booking-access_log common 
<Directory /> 
    Options FollowSymLinks 
    AllowOverride All 
</Directory> 
</VirtualHost> 

<VirtualHost *:5321> 
    DocumentRoot /var/www/html/watermelon/ik/webroot 
    ServerName hotspot.local 
    ErrorLog logs/hotsppot.local-error_log 
    CustomLog logs/hotsppot.local-access_log common 
    <Directory /> 
     Options FollowSymLinks 
     AllowOverride All 
    </Directory> 
</VirtualHost> 

和他们有相同的.htaccess:

<IfModule mod_rewrite.c> 
    RewriteEngine On 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME} !-f 
    RewriteRule ^(.*)$ index.php [QSA,L] 
</IfModule> 

有时第一虚拟主机加载第二个的虚拟主机指数.PHP!

有什么想法?

+0

加载'hotspot.local'时是否使用了正确的端口? I.E. 'HTTP://hotspot.local:5321'? – Gerben

回答

1

这可能是因为您使用默认的在/ etc/apache2的/网站可用/

检查您是否已经安装了可用的站点正确,还检查在/ var Apache的日志/日志/ Apache2的