开发者

ASP.Net - Url Forwarding with Rewriting

I am developing a web site that uses a CMS and my actual home page is at mydomain.com/cms/home.aspx

When a user visits mydomain.com/index.aspx how to do I forward the site visitors to mydomain.com/cms/home.aspx?

One way is to create a dummy index.aspx with redirect to mydomain.com/cms/home.aspx but just wondering if there is开发者_JAVA技巧 a better way to do... may be in web.config or somewhere else!

Thanks

Sid


Redirects: How to redirect a URL path in IIS?

Rewrites: http://learn.iis.net/page.aspx/460/using-the-url-rewrite-module/

Both are a bit of learning, but can be achieved in a reasonable amount of time.

You always have the option of writing your own. For rewrites, you can write an HTTPModule (or update your CMS's rewrite module). For redirects, you can use a custom 404 page to handle redirects. I have done both for DotNetNuke. Rolling my own took about 16 hours, but handles a few hundred thousand of each efficiently with caching.


<redirect url="index.aspx" to="~/Pages/1/home.aspx"></redirect>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜