WAMP虚拟主机AllowOverrides所有抛出500错误

时间:2012-03-27 23:19:16

标签: 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内部服务器错误。

我会向任何可以帮助我的人发出一些重要的善意的感觉。

更新:

我打开了服务器日志,发现以下错误......

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]

还不确定。

1 个答案:

答案 0 :(得分:6)

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

  

启用名为mod_rewrite的Apache模块。

     

要执行此操作,请单击WAMP托盘图标,然后选择Apache&gt;模块&gt;   重写模块

相关问题