首页 > apache rewrite 规则问题?

apache rewrite 规则问题?

1 hi ,我想实现以下的规则:
所有的请求定位到index.php
所有的资源(图片css啊之类的)直接访问

我的.htaccess 应该要怎么写呢????


<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^(.*)$ index.php [QSA,PT,L]
</IfModule>
  1. Cond 是这样的。如果存在该文件或者文件夹,那么直接访问。

  2. OK,不存在,则进行Rule 重写,全部指向到index.php

【热门文章】
【热门文章】