SAE绑定域名到子目录


原文地址 http://cloudbbs.org/forum.php?mod=viewthread&tid=19999

首先,把域名绑定到SAE应用。绑定域名后,写Appconfig。Appconfig保存在代码目录的config.yaml文件。绑定域名到子目录的写法如下:
name: dbonly
version: 1
handle:
- rewrite:if ( in_header["host"] ~ "sign.dbonly.com" && path ~ "^(?!sign/)(.*)" ) goto "sign/$1?%{QUERY_STRING}"
- rewrite:if ( in_header["host"] ~ "love.dbonly.com" && path ~ "^(?!love/)(.*)" ) goto "love/$1?%{QUERY_STRING}"
- rewrite:if ( in_header["host"] ~ "www.dbonly.com"&& !is_file() &&path ~ "^(?!www/)(.*)" ) goto "www/$1?%{QUERY_STRING}"
代码的意思是,
sign.dbonly.com绑定到"/sign"目录,
love.dbonly.com绑定到"/love"目录,
www.dbonly.com绑定到"/www"目录

本文来自SAE官方论坛

声明:豆瓣不小心|版权所有,违者必究|如未注明,均为原创|本网站采用BY-NC-SA协议进行授权

转载:转载请注明原文链接 - SAE绑定域名到子目录


Don't Worry,Be Happy!