开发者

Another apache rewrite question

开发者 https://www.devze.com 2023-01-18 01:13 出处:网络
In my scenario I redirect \"/index/../\" to \"/index.php?act=..\". I was开发者_JS百科 wondering how can I restrict direct access to \"/index.php\" but still be able to redirect from \"/index/../\"?

In my scenario I redirect

"/index/../" to "/index.php?act=..".

I was开发者_JS百科 wondering how can I restrict direct access to "/index.php" but still be able to redirect from "/index/../"?

P.S. "/../" is anything... it seems you can't use * there. O.o


Add the following to your rewrite script RewriteCond %{REQUEST_URI} !index.php$ [NC]. This rule will fail for /index.php (but not /index.php?whatever). At least I think it will, I haven't tested it.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号