系统规格
- Mac OS 塞拉利昂
- Brew 安装:Apache/2.4.23
当我访问 localhost/mypage.php => 工作
当我访问 localhost/mypage => 不起作用
我的配置
# /usr/local/etc/apache/2.4/extra/httpd-vhosts.conf
<VirtualHost *:80>
ServerName localhost
Redirect permanent / https://localhost/
</VirtualHost>
<VirtualHost *:443>
ServerName localhost
DocumentRoot "/Users/myuser/Documents/mywebsite/httpdocs"
DirectoryIndex index.php
<Directory "/Users/myuser/Documents/mywebsite/httpdocs">
Options +FollowSymLinks +MultiViews -Indexes
AllowOverride all
Require all granted
</Directory>
SSLProtocol -all +TLSv1.2
SSLHonorCipherOrder On
SSLCipherSuite HIGH:MEDIUM:!MD5:!RC4:!3DES
SSLCertificateFile /usr/local/etc/apache2/2.4/ssl/localhost.crt
SSLCertificateKeyFile /usr/local/etc/apache2/2.4/ssl/server.key
</VirtualHost>
我的故障排除
在选项行中,我尝试了以下操作:
- 选项 +FollowSymLinks +MultiViews
- 选项 FollowSymLinks 多视图
是的,我确实重新启动了 Apache。
显然,MultiViews 依赖于协商模块。
Mac 安装 Apache 时默认注释掉以下模块!!
我只是取消注释并重新加载 Apache。现在它起作用了!