Skip to main content
Hack

Redirect No Host to WWW Host

By September 23, 2011No Comments

Here is the code required to redirect no host to a www host. PHP and ASP versions of the code are included.

PHP

ASP
<% if Request.ServerVariables("HTTP_HOST") = "domain.com" then Response.Redirect("http://www.domain.com") %>