hide page url asp.net

寵の児 提交于 2019-12-02 03:16:43

See ScottGu's explanation about this issue here : Tip/Trick: Url Rewriting with ASP.NET

use ajax to load your content or use one big <frameset>.

But, don't do it. It will break the possibility for users to make bookmarks, make it harder / impossible for Google to crawl your website.

Obfuscating the actual URL is very bad practice both in usability and debugging.

If you really, really need to do it you can use HTML frames by having a parent frameset page at your desired url and your actual pages in a full-width full-height frame inside the frameset.

http://www.w3.org/TR/WD-frames-970331

You can use Uri. Create a new Uri object and then use the Host method.

how do you identify what page you should use?

Your could use url rewriting module(iis) for friendly urls like these:

www.mysite.com/page/1

www.mysite.com/page/2

www.mysite.com/page/3

If you are desperate and having trouble with other options you could do the follow. I definitely wouldn't recommend this approach because it's ugly but it would probably get the job done:

  1. On www.mysite.com/page[1|2|3].aspx Page_Load method, issue a Response.Redirect("www.mysite.com/") if and only if Request.UrlReferrer is not www.mysite.com/page[1|2|3].aspx

  2. On www.mysite.com/[default.aspx], issue a Server.Transfer("page[1|2|3].aspx") if the Request.UrlReferrer is www.mysite.com/page[1|2|3].aspx. Server.Transfer will pull the page on the server side and respond with the result, rather than issuing a 301 redirect so the user will still see www.mysite.com/ on their browser.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!