Mobile app version of vmapp.org
Login or Join
Gretchen104

: Permanent redirect domain to www subdomain without web.config I've just set up a site via 1and1 and have run into an issue, I want to accomplish the simple task of redirecting the root domain

@Gretchen104

Posted in: #1and1 #AspNet #Domains #Iis7 #Redirects

I've just set up a site via 1and1 and have run into an issue, I want to accomplish the simple task of redirecting the root domain to the www sub domain however due to complications I cant seam to find a way to get it to work.

I'm on a Microsoft (asp.net) package so can't use .htaccess, also the IIS server they have doesn't have the URL redirect module installed (so can't use <rewrite> in web.config).

They have built in HTTP forwarding options however if I set the root domain to redirect to the www sub domain it just infinitely redirects.

Hopefully there is some obvious option/method I've missed during the past two days of searching!

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Gretchen104

1 Comments

Sorted by latest first Latest Oldest Best

 

@Radia820

You can redirect using VBScript

<%@ Language=VBScript %>
<%
' Permanent redirection
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://www.domain.com/"
Response.End
%>


You can also use JavaScript

<script type="text/javascript">
window.location.href='http://www.domain.com/';
</script>


Or finally redirection with META Refresh HTML

<meta http-equiv="refresh" content="0;url=http://www.domain.com/">

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme