Redirect your website to another URL via code
If you wish to redirect your website to another URL via code, please follow the steps below:With ASP code directly in the “default” webpage:
- Open the web-page via File Manager or a FTP client.
- Add the following code to your web-page, replacing www.domain.com with the new URL where you wish to redirect to:
<%@ Language=VBScript %> <% Response.Status="301 Moved Permanently" Response.AddHeader "Location", "http://www.domain.com" %>
PS. Change domain.com to the URL to which you wish to re-direct the website.
With ASP.NET code directly in the “default” webpage:
1. Open the web-page via File Manager or a FTP client. 2. Add the following code to your web-page, replacing www.domain.com with the new URL where you wish to redirect to: private void Page\_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.domain.com"); }
PS. Change domain.com to the URL to which you wish to re-direct the website.
Using WEB.CONFIG 301 redirect:
This example, will redirect important pages of your site that have .htm extensions and you want the new location to be its own directory (IE. http://domain.com/services.htm will change to http://domain.com/services/).- Edit the web.config either via File Manager or FTP client.
- Add the code below:

