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.