我正在構建一個php框架,將所有流量重定向到ROOT/public/index.php,然後將url放入get請求中。我的問題是我的RewriteConds不能正常工作,正在接受文件和文件夾名稱。Mod_rewrite - 重寫條件不起作用
在根目錄
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]
</IfModule>
<files .htaccess>
order allow,deny
deny from all
</files>
在公共目錄
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?url=$1 [PT,L]
</IfModule>
快速的問題是ü運行它在http://本地主機/或你運行它在DS – kyle1046 2012-04-20 20:18:05
在localhost – 2012-04-21 00:40:25
沒有運行if語句刪除,浪費資源而不是必需的。 – JREAM 2012-04-21 02:24:49