我有一个在 WAMP 上完美设置的虚拟主机,就像这样......

#
# Use name-based virtual hosting.
#
NameVirtualHost *:80

#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.
#


<VirtualHost *:80>
    DocumentRoot "C:/wamp/www"
    ServerName localhost
    ServerAlias localhost

</VirtualHost>

<VirtualHost *:80>
    DocumentRoot "D:\Work\BOT\public"
    ServerAlias bot.dev
    ServerName bot.dev
    <Directory "D:\Work\BOT\public">
        Options Indexes FollowSymLinks
        AllowOverride None
        Order allow,deny
        Allow from all
    </Directory>
</VirtualHost>

我在 bot.dev 上运行 Zend Framework 应用程序,所以我需要 AllowOverrides 才能使 url 工作。但是,当我将 AllowOrverride 更改为 All 时,我收到 500 Internal Server Error。

我将向任何可以帮助我的人发出一些重大的善意共鸣。

更新:

我打开服务器日志,发现如下错误...
D:/Work/BOT/public/.htaccess: Invalid command 'RewriteEngine', perhaps misspelled or defined by a module not included in the server configuration

所以问题一定出在.htaccess中:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^.*$ - [NC,L]
RewriteRule ^.*$ index.php [NC,L]

还不确定是什么。

最佳答案

在这里找到答案:http://www.phpfreaks.com/forums/index.php?topic=260159.0

关于apache - WAMP 虚拟主机 AllowOverrides All 抛出 500 错误,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/9899087/

10-13 03:24