ASP.NET应用程序的url重写
我有一个域 A.com,包含 2 个 asp.net 应用程序“B”和“C” 其中 B 和 C 通过引用相关。 我想..在输入网址 www.A.com 时,用户应打开页面 www.A.com/B/Default.aspx 但地址栏应显示 www.A.com 项目应用程序 B 和 C 中的 url 重写工作正常。但是我如何在根目录中的项目之外设置 url 重写。 我已经尝试过 http://urlrewriter.net/ 和 http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx 这些对于项目 B 和 C 来说工作正常...
但我无法在根目录中的 web.config 文件中设置配置。问题在于从项目外部重写页面。我需要在 IIS 中进行一些设置吗?我正在使用 godaddy 的 Windows 主机。
请帮助...
如果你能帮助我编写代码,那就太好了。谢谢.. 我在项目 B 中使用此 web.config 设置,同时重写 B 中的页面。
<configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="B.Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, B.Intelligencia.UrlRewriter"/>
</configSections>
<system.web>
<httpModules>
<add name="UrlRewriter" type="B.Intelligencia.UrlRewriter.RewriterHttpModule, B.Intelligencia.UrlRewriter"/>
</httpModules>
</system.web>
<rewriter>
<rewrite url="/Default.aspx" to="/About.aspx"/>
</rewriter>
其中我指的是此处存在的 url 重写 dll https://github.com/sethyates/urlrewriter
但我无法在根目录中设置 web.config 设置以从 www.A.com 重定向到 www.A.com/B/Default.aspx 如果你能帮助我一些基本的想法或代码,那就太好了......谢谢......
I have a domain A.com, containing 2 asp.net applications 'B' and 'C'
where both B and C are related by reference.
I want.. on entering url www.A.com users should open up the page www.A.com/B/Default.aspx but address bar should show www.A.com
url rewriting within project application B and C are working fine. But how can i set up url rewriting outside the projects in the root directory.
I have tried out the tutorials present in http://urlrewriter.net/ and http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
and these are working fine for project B and C...
but i cant set up the configuration in web.config file in the root directory. The problem is with rewriting a page from outside the project. Do I need to make some settings in the IIS. I am using godaddy' windows hosting.
please help...
It will be great if you can help me with the code. Thanks..
I am using this web.config setting in project B while rewriting pages within B.
<configuration>
<configSections>
<section name="rewriter" requirePermission="false" type="B.Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, B.Intelligencia.UrlRewriter"/>
</configSections>
<system.web>
<httpModules>
<add name="UrlRewriter" type="B.Intelligencia.UrlRewriter.RewriterHttpModule, B.Intelligencia.UrlRewriter"/>
</httpModules>
</system.web>
<rewriter>
<rewrite url="/Default.aspx" to="/About.aspx"/>
</rewriter>
where i am referring the url rewrting dll present here https://github.com/sethyates/urlrewriter
But I cant set up the web.config setting in the root directory for redirecting from www.A.com to www.A.com/B/Default.aspx
It will be great if you can help me with some basic idea or code... thanks..
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
urlrewriter 附带源代码,您可以修改代码并重建它。该代码适用于通用用途,但您的代码是特定用途的。所以对代码进行一些修改就可以实现你想要的了。如果您需要我帮助您处理代码,请告诉我
urlrewriter comes with source code and you can modify the code and rebuild it. The code is for generic usage but your's is specific one. So make some changes in the code and you can achieve what you want. Let me know if you want me to help you with the code