I wanna redirect all the traffic which comes to a website to the website with the new domain. How can I do this in asp? On apache it would be an easy entry in the .htaccess but asp? tia for your help
You do it with the global.asa or global.asax depending on if it is classic or .net file but this only fires if the request is for a page that will go through the asp/ .net framework. It is one of the few negatives of IIS -v- Apache unfortunately. You are also probably better doing a 301 or 302 redirection but that is up to you on what your trying to achieve
what about adding the old site url as a host header on the new site and deleting the iis entry for the old one. Google might not like it though.
If you are using asp.net... <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://your-new-domain.com/"); } </script> Code (markup):