【发布时间】:2009-09-07 17:39:15
【问题描述】:
我有一个应用程序,其中大部分仍在开发中,这就是为什么我需要阻止对所有页面的访问,而不是其中两个。
假设我有 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 的答案,因为我更了解规则,感谢两个答案..
标签: mod-rewrite redirect