【发布时间】:2017-08-02 03:44:16
【问题描述】:
我在使用 Apache2 自动加载子目录中的 index.php 时遇到问题。 这是我在连接时在浏览器控制台中看到的:
GET http://example.com/login HTTP 301 Moved Permanently
GET http://10.0.3.10/login/
Connection Timed Out
当我输入http://example.com/login/ 时,它按预期工作。还, 根目录正确重定向到 index.php。
我对这个主题还很陌生,希望得到任何帮助。
默认虚拟主机设置:
#NameVirtualHost *:80
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName example.com/
ServerAlias www.example.com/
DocumentRoot /var/www/example.com/
<Directory />
AllowOverride All
DirectoryIndex index.php
</Directory>
<Directory /var/www/example.com/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>
...
httpd.conf:
<IfModule dir_module>
DirectoryIndex index.php
</IfModule>
未使用 .htaccess 文件。
【问题讨论】:
标签: php apache redirect apache2