asp.net - Redirect from www to non-www with using subdomain -


i need redirect url www non-www when user enters url subdomain.

example:

www.abc.xyz.com abc.xyz.com

string url = request["http_request_url"];  // not sure exact constant name of header uri uri = new uri(url); if(uri.host.startswith("www.") && uri.host.count(c => (c == '.'))>2) {     response.redirect(url.replace("www.", "")); } 

thought said before, think redundant because browsers checks you...
, should avoid being "too smart own good".


Comments

Popular posts from this blog

curl - PHP fsockopen help required -

HTTP/1.0 407 Proxy Authentication Required PHP -

c# - Resource not found error -