Try: <% response.setStatus(301); response.setHeader( "Location", "http://www.new-url.com/" ); response.setHeader( "Connection", "close" ); %> or <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently" ; Response.AddHeader("Location","http://www.example.com/new_url") ; } </script>
You can also do a .htaccess 301 redirect with: Options +FollowSymLinks RewriteEngine on RewriteRule (.*) http://www.newdomain.com/$1 [R=301,L] or if you want to point domain.com to www.domain.com Options +FollowSymlinks RewriteEngine on rewritecond %{http_host} ^domain.com [nc] rewriterule ^(.*)$ http://www.domain.com/$1 [r=301,nc]
If you do the .htaccess 301 redirect. You will have to wait for apache to be restarted on your server before it will work. So if it doesn't work instantly, that may be the reason.