xj728 - 2008-5-26 12:44:00
我在HttpModule类的ReUrl_BeginRequest方法里增加了下面的代码
else if (requestPath.StartsWith(forumPath + "rm/"))
{
//当使用伪aspx, 如:showforum-1.aspx等.
if (config.Aspxrewrite == 1)
{
string path = requestPath.Substring(forumPath.Length + 5);
foreach (SiteUrls.URLRewrite url in SiteUrls.GetSiteUrls().Urls)
{
if (Regex.IsMatch(path, url.Pattern, Utils.GetRegexCompiledOptions() | RegexOptions.IgnoreCase))
{
string newUrl = Regex.Replace(path, url.Pattern, Utils.UrlDecode(url.QueryString), Utils.GetRegexCompiledOptions() | RegexOptions.IgnoreCase);
context.RewritePath(forumPath + "rm" + url.Page, string.Empty, newUrl);
return;
}
}
}
return;
}
为什么访问rm目录里的.aspx文件时,还是提示找不到资源?而与之相同的tools目录里就没有问题呢?
xj728 - 2008-5-26 15:00:00
顶
顶顶
买空间网14 - 2008-5-27 13:55:00
这个我还不知道呢?来学习学习的哦!~~~
xj728 - 2008-5-28 20:25:00
搞定了,如果是直接在论坛里新建目录,再修改HttpModel代码是可以成功的.如果是从别的网站直接放则不可以