Want to create a action filter to force Url to be using SSL
- by Blankman
I want to create a action filter that will check the url, and if its not using Ssl, redirect to the same page but with SSL.
What is the best way of doing this?
Should I just check the RawUrl, and scan the string for https, and if its not there then do:
context.Response.Redirect(context.Request.RawUrl.Replace("http:", "https:"));