這次的目標是把
http://myid.domainaaa.com
這個網址
轉到
http://www.domainbbb.com/myid
以下就是要寫在Request Rewriting裡的
RULE_0_START:
match IN:Host into $ with ^([0-9a-zA-Z]{1,30})\.domainaaa\.com
if not matched then goto RULE_0_END
if matched
set URL= http://www.domainbbb.com/$1
set RESPONSE = 301
set OUT:Location = %{URL}
set BODY = <a href="%{URL}">go</a> \n
endif
goto END
RULE_0_END:
[0-9a-zA-Z]{1,30}可以自己替換正規表示式的條件
這裡是挑出1~30個字的大小寫英文或數字
如果符合的話才會轉過去
參考資料: (好多XD)
http://www.codingforums.com/showthread.php?t=156570
http://support.zeus.com/zws/examples/2006/03/07/rewrite_redirecting
http://www.register365.com/knowledge/scripting/rewrite_scripts/528-zeus_rewrite_rules_user_guide.html
http://www.chinazeus.com/read.php?tid=6
銅廠加印 同場加映
php header的301 redirect方法
header("Location: http://www.domainbbb.com",TRUE,301);
exit;
怎麼php的簡潔很多XD