RewriteEngine On
RewriteRule ^/ai?$ /Market/publish.jsp [QSA,L,PT]
RewriteRule ^/ar?$ /Market/MailDispatch [QSA,L,PT]
RewriteCond %{HTTP_HOST} !^web\.example\.com [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule ^/(.*) http://web.example.com/$1 [L,R]
#How skip www\. to web\. for this 1 ?
#RewriteRule ^/vi/?([0-9]+)\.htm$ /Market/vi.do?id=$1 [PT,L]
RewriteRule ^/li /Market/list.do [QSA,PT,L]
RewriteRule ^/vi/locations.jsp /Market/locations.jsp [PT,L]
ErrorDocument 404 /notfound.html
幾乎可以撤銷(?)我試http://example.com/vi/{N}.htm
應重定向到http://web.example.com/vi/{N}.htm
其中N
是動態ID。mod_rewrite如何添加子域名?
看mod_rewrite with subdomain and url pattern 有使如http://example.com/vi/1096.htm
向上傳遞下一個版本http://web.example.com/vi/1096.htm
其中數字是動態沒有明確的辦法。我試圖
「傳遞到下一個版本」是什麼意思?根據你的例子,你現有的代碼應該做你想做的事情(雖然也許你的'RewriteRule'語句不應該有'/'前導),所以我認爲我誤解了你的問題;你能否試着澄清你的意思? – 2010-07-13 13:58:20
現在很喜歡它的作品,意思是通過模板從LAMP遷移到GAE – 2010-07-23 19:56:06