domain rewrite

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 年 前
hay,
I want to refer to the address without the www
For example:
when i go to google.com

i want the direct to www.google.com

i try to do it with iis but it dont work


thenk
12 年 前
It depends on you hosting. They can let you go with www or without it, or both options.
12 年 前
you can do it with code

string strAddress = Request.ServerVariables["SERVER_name"];
            if (strAddress == "yourdomain.com")
            {
                Response.Status = "301 Moved Permanently";
                Response.AddHeader("Location", "http://www.yourdomain.com");
            }
12 年 前
thenk man but wher i put that????  hah aha
12 年 前
hezyz wrote:
you can do it with code

string strAddress = Request.ServerVariables["SERVER_name"];
            if (strAddress == "yourdomain.com")
            {
                Response.Status = "301 Moved Permanently";
                Response.AddHeader("Location", "http://www.yourdomain.com");
            }




themk man its work!!!
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.