ASP.NET HTTPS and RelativeUrls
I have a website with an SSL certificate for www.foo.com. What's the cleanest way to redirect requests to the https: // prefix? Should I create link servers side-by-side instead of relying on URL resolution with relative paths, ~ /?
Also, let's say I am redirected to the https: // page, the links on the page are created on the master page and resolved using relative paths. If the user clicks on any navigation item, they are essentially stuck at the https: // path, what's the best way to clear it?
All paths must work in dev (localhost), staging and production environments.
a source to share
No, you don't have to do anything,
Unless you issue a fully qualified url, your redirects and relative urls of the relative url are always considered together with https: //, for example
Your page url is https: //mysite/folder1/page.aspx , and if you issue Response.Redirect ("/folder2/page2.aspx") then the website server only issues the relative url "/ folder2 / page2. aspx ", but the client (IE / FF2 / Safari) adds" https: // mysite "before the URL.
So, as long as you use relative URLs in your project, you are safe.
a source to share