在yii中通过.htaccess重定向请求

时间:2015-05-26 09:18:59

标签: php apache .htaccess yii server

我正在处理yii 1项目并且我编写了一个.htaccess文件,每个请求都会检查以查看: 如果请求想要一个文件,那么它必须直接接收它,否则请求必须到达index.php并启动一个yii应用程序实例来处理它。
这是我的.htaccess:

RewriteEngine on

# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

# otherwise forward it to index.php
RewriteRule . index.php

#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/javascript text/css

这是我的文件结构:
enter image description here

但是对于每个请求,我都会收到内部服务器错误。我该怎么编辑我的.htaccess?

0 个答案:

没有答案