apache - 多个网站无限 index.php 循环
问题描述
我正在尝试在同一个域中发送不同的 Symfony 网站。实际上,我每个人都有 1 个文件夹,例如:
html/site1
html/site2
html/...
这是 .conf (CentOS & Apache):
AliasMatch "^/site1(.*)" "/var/www/html/site1/public"
<VirtualHost *:80>
ServerName example.com
ServerAlias https://example.com
DocumentRoot /var/www/html/site1/public
<Directory /var/www/html/site1/public>
AllowOverride All
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
ErrorLog /etc/httpd/conf.d/site1.log
</VirtualHost>
AliasMatch "^/site2(.*)" "/var/www/html/site2/public"
<VirtualHost *:80>
ServerName example.com
ServerAlias https://example.com
DocumentRoot /var/www/html/site2/public
<Directory /var/www/html/site2/public>
AllowOverride All
Order Allow,Deny
Allow from All
<IfModule mod_rewrite.c>
Options -MultiViews
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php [QSA,L]
</IfModule>
</Directory>
ErrorLog /etc/httpd/conf.d/site2.log
</VirtualHost>
AliasMatch 似乎工作,但我得到一个无限循环,结果是:
example.com/siteX/index.php/index.php/index.php/index.php/index.php/index.php/... ERR_TOO_MANY_REDIRECTS
即使我从站点获得响应,服务器似乎也在尝试重定向我,因为日志正在写入,好像一切正常。
解决方案
推荐阅读
- android - 具有单一数据输入的 MPAndroid 折线图
- java - Spring Security“requiresSecure()”结果 ERR_TOO_MANY_REDIRECTS
- c# - 从系统内存中释放位图以将其删除 C#
- python - 可视化分类器预测,分散
- scanf - 为什么野牛语法规则中的scanf不起作用?
- java - [Java][XSLT] 替换所有 XML 中的 Map 值
- java - OSGI 中的全局 servlet 异常处理。如何?
- java - 将链表 list_1 的第一个元素添加为链表 list_2 的最后一个元素,并将其从 list_1 中删除
- c - 用C语言向服务器发送HTTP请求后什么也没有收到
- ida - 为什么 RH850G3K 不在我的 IDA 的处理器类型列表中?