1

I have read this documentation but it doesn't solve my case https://learn.microsoft.com/en-us/previous-versions/dotnet/articles/ms972974(v=msdn.10)

for example I want to hide this url http://yoursite.com/info/dispEmployeeInfo.aspx?EmpID=459-099&type=summary

to be only http://yoursite.com

Note: I've read this question How to hide asp url in url bar? but unfortunately the answers are not satisfying enough

Juli Andika
  • 57
  • 10
  • Why though? Wouldn't that make your site harder to use? I suspect you can only do this through Javascript. – ProgrammingLlama Jul 01 '19 at 03:04
  • Do you mean you want to hide the URL parameter ? "?EmpID=459-099&type=summary" – Sarav Jul 01 '19 at 03:05
  • @saravanakumar v Not only the parameter, but also the page name – Juli Andika Jul 01 '19 at 03:08
  • @John Could you please help with any solution – Juli Andika Jul 01 '19 at 03:08
  • Possible duplicate of [How to hide asp url in url bar?](https://stackoverflow.com/questions/11288051/how-to-hide-asp-url-in-url-bar) – Sarav Jul 01 '19 at 03:09
  • Yes, I've read those question, but the answers are not satisfying enough – Juli Andika Jul 01 '19 at 03:10
  • Is a [redirect](https://stackoverflow.com/questions/888325/how-to-redirect-a-url-path-in-iis) different than what you are looking for? – Miguel Mateo Jul 01 '19 at 03:15
  • If redirect does not help, try [URL Routing](https://learn.microsoft.com/en-us/aspnet/web-forms/overview/getting-started/getting-started-with-aspnet-45-web-forms/url-routing), available from IIS 4.0 – Miguel Mateo Jul 01 '19 at 03:19
  • 1
    Looks like XY-problem to me. Why do you think that you need to hide that url? – vasily.sib Jul 01 '19 at 03:52
  • 1
    "Not satisfying enough" is not descriptive enough. What makes the answers there not satisfying enough? Be specific on how they are failing you. Perhaps add an example of what you have tried, again illustrating how your approach is failing. – Jon P Jul 01 '19 at 06:18

1 Answers1

2

There is no simple way to hide the address bar. The browser always shows the current address of the top-most document.

If you don't want that address to show, you have a few options:

  1. Use a client-side rendering framework (React, Angular, etc) that doesn't rely on URLs to decide what's currently being shown. This will use a lot of REST-like calls to view/update data.
  2. Request the page via a form post. You can send the ID with the POST data, rather than it being in the URL.
  3. Embed the page whose URL you want to hide using <iframe> element. The URL being requested from the server will still contain the query string parameters, it just won't be immediately visible to the user.
  4. You can use the JavaScript window.open function to open the page in a full pop-up window, and use the option location=0 to hide the location bar. Note that some modern browsers will ignore this and will display the location anyway.

Using the URL Rewriting module, you can't hide that identifier. You can only build it into the URL in a way that's prettier to look at, e.g. https://yoursite.com/employee/459-099/summary.

NZgeek
  • 199
  • 4