我有一個應用程序,它大部分仍在開發中,這就是爲什麼我需要阻止所有頁面上的訪問,但不是其中兩個。重寫規則存在問題
假設我有a.php所有的請求將被重定向到這裏除了b.php。
所以,我覺得應該有3個規則:
1st: when a.php and b.php are requested they should be visible to user,
2nd: if anything other than those two is requested,
it should be redirected to a.php.
3rd: for external css,javascript and image files
there should be an access rule
因爲我沒有與服務器管理太多的經驗,我認爲我完全失去了:)
這是我的嘗試:
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !^/b.php
RewriteRule !\.(js|ico|txt|gif|jpg|png|css)$ a.php
對於這兩個答案+1我選擇了Gumbo的答案,因爲我更瞭解規則,謝謝你的答案。 – Sinan 2009-09-08 13:15:37