iis下的伪静态规则httpd.ini。
首先有个前提是支持伪静态,这个很容易实现,一般空间都是支持的,所以不比担心这个。
直接上伪静态规则如下:iis下的伪静态文件是httpd.ini,只需把以下代码保存在httpd.ini,传到空间支持伪静态的地方即可。
[ISAPI_Rewrite]
RewriteCond Host: bbs\.xxx\.com
RewriteRule ^/(.*) /bbs/$1 [I,L]
RewriteCond Host: blog\.xxx\.com
RewriteRule ^/(.*) /blog/$1 [I,L]
RewriteCond Host: ^xxx\.com$
RewriteRule (.*) http\://www\.xxx\.com$1 [RP,I]
RewriteCond Host: bbs\.xxx\.com
RewriteRule ^/(.*) /bbs/$1 [I,L]
/////这里的意思是,bbs.xxx.com访问的是bbs文件夹
RewriteCond Host: blog\.xxx\.com
RewriteRule ^/(.*) /blog/$1 [I,L]
/////这里的意思是,blog.xxx.com访问的是blog文件夹
RewriteCond Host: ^xxx\.com$
RewriteRule (.*) http\://www\.xxx\.com$1 [RP,I]
/////这里的意思是,输入xxx.com跳转到www.xxx.com