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