nginx将所有请求重定向到root,除非它是root用户

时间:2013-10-23 13:48:23

标签: redirect nginx rewrite

我需要将永久性所有(例外情况除外)请求重定向到root /它将提供文件的地方whatever.html

.i.e。

All should give 301 permanent to /
http:://www.domain.tld/whatever/anything/realy  == 301 ==> http://www.domain.tld
http:://www.domain.tld/blabla  == 301 ==> http://www.domain.tld
http:://www.domain.tld/ == 301 ==> http://www.domain.tld

except for
http://www.domain.tld/special.html == serve ==> special.html


root should serve the defailt file (as specificed in index)
http:://www.domain.tld  == serve => somefile.html

任何想法?

0 个答案:

没有答案