IIRF 二级域名访问

EncoreLau 2011-08-25 04:52:15
IsapiRewrite4.ini

RewriteCond %{HTTP_HOST} ^(?!www\.xxx\.com).*$ [I]

RewriteCond %{HTTP_HOST} ^([^\.]+)\.xxx\.com$ [I]

RewriteRule ^/$ /blog.aspx?id=%1 [U,L]


当访问aaaaaa.xxx.com 时显示无法找到该网页


RewriteRule ^/User/(\d+)$ /User.aspx?id=$1 [I, L]
RewriteRule ^/User/(\w+)$ /User.aspx?name=$1 [I, L]

这样设置就能正确找到....

求解正则匹配,还是IIS设置问题

想达到效果是访问aaaaaa.xxx.com 实际访问路径是xxx.xxx.com/shop/url.asp?name=xxxx 无限二级域名
...全文
172 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
truecoffeefox 2011-08-26
  • 打赏
  • 举报
回复
当然要有泛解析
truecoffeefox 2011-08-26
  • 打赏
  • 举报
回复
为什么看官方文档捏
# IIRF.ini
#
# demonstrates transforming domain names to querystring params.
#

RewriteEngine ON
RewriteLog c:\inetpub\iirfLogs\iirf
RewriteLogLevel 1
StatusInquiry ON
CondSubstringBackrefFlag *

# +++++++++++++++++++++++++++++++++

# Transform any domain name that is not www, into a query
# string param. The reference character for captured
# groups in the RewriteCond, is * , according to the
# CondSubstringBackrefFlag directive. (* is also the default).

RewriteCond %{HTTP_HOST} ^(?!www)([^.]+)\.mydomain\.com [I]
RewriteRule ^/(.*)$ /mypage?host=*1 [U,L]
EncoreLau 2011-08-26
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 lmaohuanl 的回复:]

string r=Regex.Replace("aaa.test.com/b.html", "(\\w+)(\\.\\w+\\.\\w+\\/)(\\w+\\.\\w+)", "www$2$1/$3");
[/Quote]
我需要的是.ini文件里面的正则 不是这种的
LMAOhuaNL 2011-08-26
  • 打赏
  • 举报
回复
string r=Regex.Replace("aaa.test.com/b.html", "(\\w+)(\\.\\w+\\.\\w+\\/)(\\w+\\.\\w+)", "www$2$1/$3");
josephSC 2011-08-26
  • 打赏
  • 举报
回复
up~
EncoreLau 2011-08-26
  • 打赏
  • 举报
回复
[Quote=引用 7 楼 truecoffeefox 的回复:]

当然要有泛解析
[/Quote]

泛解析 当然有...但是其他二级域名访问的时候总是跳到默认的页面,不经过重写
子夜__ 2011-08-25
  • 打赏
  • 举报
回复
不会正则 友情UP。

62,041

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧