请详细解释这个.htaccess文件

时间:2014-06-14 22:37:32

标签: apache .htaccess

RewriteEngine on # I know it will make RewriteEngine on.
RewriteCond %{REQUEST_FILENAME} !-f # So, what is it?
RewriteCond %{REQUEST_FILENAME} !-d # So, what is it?
RewriteRule .* index.php/$0 [PT,L] # So, what is it?

Pastebin Link

1 个答案:

答案 0 :(得分:0)

这看起来非常像Drupal的重写规则。非常简单:

打开重写引擎

RewriteEngine on

如果提供的URI未指向实际文件

RewriteCond %{REQUEST_FILENAME} !-f

或目录

RewriteCond %{REQUEST_FILENAME} !-d

然后将整个URI传递给index.php脚本

RewriteRule .* index.php/$0 [PT,L]