Zend .htaccess配置在Ubuntu中不起作用

San*_*kha 3 zend-framework apache2 ubuntu-10.04

嗨,我正在运行Ubuntu 10.04 LTS - Lucid Lynx我创建了一个项目

zf创建项目测试

此命令自动生成.htaccess文件无法正常工作我通过编辑/ etc/apache2/sites-available/default文件设置配置了我的web服务器(Apache2)

<Directory /var/www/>
 Options Indexes FollowSymLinks MultiViews
 AllowOverride All
 Order allow,deny
 allow from all
</Directory>
Run Code Online (Sandbox Code Playgroud)

我收到以下错误

Internal Server Error
/**************************************************************************************/
The server encountered an internal error or misconfiguration and was unable to complete your request.

Please contact the server administrator, webmaster@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error.

More information about this error may be available in the server error log.
Apache/2.2.14 (Ubuntu) Server at localhost Port 80
/****************************************************************************************/
Run Code Online (Sandbox Code Playgroud)

请帮我

Dav*_*unt 15

你还没有加载mod_rewrite,所以Apache不知道RewriteEngine行的含义.

在ubuntu上你可以做(​​作为超级用户):

a2enmod rewrite
apache2ctl restart
Run Code Online (Sandbox Code Playgroud)

否则,您将不得不编辑apache配置并添加这样的行来加载模块

LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so
Run Code Online (Sandbox Code Playgroud)

系统上的路径可能不同.