开发者

NGINX Re-write only if url has no extension

I'm trying to rewrite requests for anything without a file extension to pass to a script.

For example:

example.com/admin.php will go to admin.php but http://www.example开发者_JAVA百科.com/param will be rewritten to http://example.com/test.php?do=param

I have it so that it will rewrite the param to ?do=param, but I can't figure out how to only do that if there is no '.' in the file name.


Try the if directive from the rewrite module:

if ( $uri !~ \. ) {  rewrite .....; }
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜