Programming, error messages and sample code

Set redirection in your code

Programming, error messages and sample code > sample code

If you want to set redirection from a domain to another, for example from http://domain-a.com to http://domain-b.com, you can set it from your code.

Please follow the steps below to set it up

1. Please create a new .asp (eg. home.asp) file to your site domain-a.com root folder with the sample code below.
<% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.domain-b.com/" %>
2. set the new .asp page as your site default page, you can set it from your hosting contorl panel -->IIS manager-->set default page, place the new .asp file (eg, home.asp) at the first line.