Hi guys, I launched many new pages last Friday and deleted old ones. I asked our "network admin" to set-up 301 redirections on our IIS 5 server so that the old pages would redirect to the splash page. What I asked was to redirect all files from certain directories to the main page. Eg. warmuseum.ca/cwm/new/index_e.html to warmuseum.ca . What I got redirects the directory, but keeps the files name eg. warmuseum.ca/index_e.html , which is a 404, defeating the purpose of having a redirection in the first place. And, since we have different domains pointing to the same content (I know, I know, it's bad.), it only works with the warmuseum.ca domain, and not the other ones. So now, I have to explain to him how to do it, even if I am not familiar with IIS. Can anyone help me with this? What is the procedure to create a simple redirection on IIS ? What was done is : - From the "home directory" tab in "Default web site properties", - When connecting to this resource, then content should come from : "A redirection to a URL" - Redirect to http://www.warmuseum.ca, the client will be sent to: "A permanent redirection for this resource." Thanks
If its .NET you can do <script runat="server"> private void Page_Load(object sender, System.EventArgs e) { Response.Status = "301 Moved Permanently"; Response.AddHeader("Location","http://www.delphi-central.com/tutorials/"); } </script> Code (markup): Simply save to a file with an ASPX extension.
That's how plain directory redirection works (on any server type) - the same resource (i.e. page) will be requested from a new location. The procedure is as you described - in the properties you just type the new path (obviously, not including the file name) and IIS will replace the matching portion of the original path (in your case it's just '/') and will append the rest to the new URL. J.D.
In IIS, the administrator needs to right click on the domain and choose properties. Under the "Home Directory" tab, there are three radio buttons. He needs to choose "A Redirection to a URL" and enter the new location in the text field below. This will set up the 301 redirect to the new location. That's about all you can do in IIS. It's not very robust in this regard. Good luck
I only have IIS6 around - you will have to look for equivalent functionality in IIS5. Here's what you need to do: * In the website properties select Home Directory > A redirection to a URL; * Check the checkbox The exact URL entered above; That's it. All requests will end up requesting this new URL. J.D.
Found an old IIS5 - same settings. Make sure that "The exact URL entered above" is checked. Otherwise you will end up redirecting requests as I described in before in this thread. J.D.
Sigh... I got this bad rep on this post: "You said the exact same thing mopacfan said three posts earlier." In my response I clarified which checkbox needs to be checked for this type of redirection to work. If you just follow mopacfan's instructions, you will not redirect all requests to the same page. My advice to whoever it was - learn to read people's posts carefully before judging. J.D.
INstead of redirecting for all those pages, since you are sending them all to the home page anyway, just delete all the old pages and do a custom 404 that does a 301 redirect to the home page.
You can still delete the pages from the server's hard drive. IIS won't need them anymore once the redirect is established.
Using custom 404 makes sense *only* if your hosting company doesn't let you do this kind of thing the right way (i.e. using IIS configuration). Those who will use this trick need to make sure that the response code is changed programmatically from 404 to 301 in the custom 404 response. J.D.