大网数据广告活动
服务器运维问答

Apache's MultiViews options it not working

· 52CE 我爱测

System specs Mac OS Sierra Brew installed: Apache/2.4.23 When I access localhost/mypage.php => works When I access localhost/mypage => does not work My configuration # /usr/local/etc/apache/2.4/extra/httpd-vhosts.conf <VirtualHos…

问题原文

原帖链接 · Jeffrey Wen · CC BY-SA 3.0

System specs

  • Mac OS Sierra
  • Brew installed: Apache/2.4.23

When I access localhost/mypage.php => works

When I access localhost/mypage => does not work

My configuration

# /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>

My troubleshooting

In the Options line, I have tried the following:

  • Options +FollowSymLinks +MultiViews
  • Options FollowSymLinks MultiViews

Yes, I did restart Apache.

已采纳解答

原帖链接 · Jeffrey Wen · CC BY-SA 3.0

Apparently, MultiViews relies on the negotiation module.

Mac's install Apache with the following module commented out by default!!

# LoadModule negotiation_module libexec/mod_negotiation.so

I simply uncommented it and reload Apache. Now it works!

摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。

资料来源与适用范围

资料来源
Server Fault
适用范围
以原帖系统、软件版本与发布日期为准(2017-01-25)
内容语言
中文;命令、路径和错误标识保留技术原文
本地收录日期
2026-11-15
授权说明
CC BY-SA 3.0

正文与所需资源由本站本地存储。查看来源及更新记录 ↗

请按适用版本和实际日志确认原因;本站没有对每一种系统或设备逐项执行文中的操作。