Apache mod_rewrite、.htaccess和虚拟主机冲突
我有两个这样的虚拟主机:Apache mod_rewrite、.htaccess和虚拟主机冲突,apache,.htaccess,mod-rewrite,Apache,.htaccess,Mod Rewrite,我有两个这样的虚拟主机: <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 Al
<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>
DocumentRoot/var/www/html/西瓜/hhgt/webroot
服务器名预订
#错误日志/预订-错误日志
#自定义日志/预订-访问\u日志通用
选项如下符号链接
允许超越所有
DocumentRoot/var/www/html/西瓜/ik/webroot
ServerName.local
ErrorLog日志/hospot.local-error\u日志
CustomLog日志/Hotspot.local-access\u日志公用
选项如下符号链接
允许超越所有
并且它们具有相同的访问权限:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
重新启动发动机
重写cond%{REQUEST_FILENAME}-D
重写cond%{REQUEST_FILENAME}-F
重写规则^(.*)$index.php[QSA,L]
有时第一个vhost加载第二个vhost index.php
有什么想法吗?这可能是因为您在/etc/apache2/sites中使用了默认设置/
检查您是否正确设置了可用的站点,并检查/var/logs/apache2中的Apache日志。加载hotspot.local时,您是否使用了正确的端口。即
http://hotspot.local:5321
?