Public Sub Filter(req As ServletRequest, resp As ServletResponse) As Boolean
If req.Secure Then
If req.FullRequestURI.StartsWith("www.") Or req.FullRequestURI.StartsWith("https://www.") Then
Dim url As String = req.FullRequestURI
resp.SendRedirect(url.Replace("https://www.", "https://"))
Return False
End If
Return True
Else
If req.FullRequestURI.StartsWith("www.") Or req.FullRequestURI.StartsWith("http://www.") Then
Dim url As String = req.FullRequestURI
url = url.Replace("http://www.","http://")
url = url.Replace("www.","")
resp.SendRedirect(url.Replace("http:", "https:") _
.Replace(Main.srvr_public.Port, Main.srvr_public.SslPort))
Return False
End If
resp.SendRedirect(req.FullRequestURI.Replace("http:", "https:") _
.Replace(Main.srvr_public.Port, Main.srvr_public.SslPort))
Return False
End If
End Sub