Force website to resolve to http://www.Mysite.com rather than http://MySite.com

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
13 years ago
Hi All,

I have a slight problem in that my security certificate is only valid for my website in the following format https://www.tietie.co.uk.  If a user enters on http://tieite.co.uk, then goes to the acount page (http://tietie.co.uk/account.aspx) they get a security cerficate warning.  So I was thinking I could add something like below to ensure that the user hits my www address.  My question is where should it go, maybe root.master?  Or is there a better way to do this that I have overlooked?


            //Make sure the user is visiting www.tietie.co.uk for https reasons
            //Excluded when running locally
            string sURL = Request.Url.ToString();
            if (sURL.Contains("//localhost") == false && sURL.Contains("//www.") == false)
            {
                sURL = sURL.Replace("//", "//www.");
                Response.Redirect(sURL, true);
            }

Any thoughts or suggestions would be appricated!

Thanks

Rick
13 years ago
Hi Rick,

this should help:

https://www.nopcommerce.com/boards/topic.aspx?topicid=2505

& vote here

http://nopcommerce.codeplex.com/workitem/8403

regards, hayden
13 years ago
Thanks Hayden, that looks like just what I need!

Rick
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.