I am creating a searching website using ASP.NET .On my one page I show URL of results.When I click on URL a new link is open but the URL path for the new link in the browser include loalhost:portnumbet.I do not want this in my URL.
For eg.
<a href = "https://www.google.com"> result </a>
so on clicking result I go to browser where the URL is “https://localhost:8080//www.google.com”
why this localhost:8080 includes in the URL.
Thanks
When you are redirecting to the URL, you will not be adding any protocol information, so it will default to the current website/protocol.
For example;
is not the same as;
You need to add the
fully qualifiedURL, otherwise it will believe it to berelativeto the current website, therefore add thehttp(s)://to the redirect.