apache - WAMP 虚拟主机 AllowOverrides 全部抛出 500 错误

标签 apache wamp virtualhost

我有一个在 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

enable the Apache module called mod_rewrite.

To do this left click WAMP tray icon and select Apache > Modules > rewrite module

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

相关文章:

javascript - CORS 在 Chrome 中不工作

apache - 在apache共享主机上部署一个用Nuxtjs制作的通用APP

php - 可以在 Windows CE、WM8650 上网本上运行 "WAMP"吗?

php - 虚拟主机 : php_value enable_post_data_reading Off : for ONE webpage

linux - CentOS 7 Apachect1 移除虚拟主机

Apache 动态虚拟主机 - 403 禁止访问

django - 使用 Apache 和 mod_wsgi 在 Centos 上设置 Django

java - 如何解决 makeHttpRequest 方法错误?

apache - 如何让 Apache 在 Ubuntu 上停止?

javascript - Angularjs 路由仅到达本地主机