I guess there's no equivalent of real .htaccess in MS but...
I've just taken on management of a "windows server 2003" "Microsoft-IIS/6.0" site and I want to create fresh pages (with meaningful names), put them in sub-directories and tell robots and browsers where the new html can be found.
What's the best way to do this (with or without using http-equivalents?)
The hosting company advised me to create a 404b.htm in a directory called /errormsg. (Is this sounding familiar?)
I cannot see a query variable in the url, the dead page is visible as the url when the 404b.htm page is displayed. Can you please tell me what to test for and how (ie. is there some way to query the url string using html?)
Also, how does one actually return a 301?
I'm pretty sure ASP is available on the site (included in the price) so perhaps I should be using an ASP approach? Or perhaps a "frontpage extension"? It's all Greek to me!
bpresent, Well the first thing that you would do is to create an asp page named whatever you want. Now either through your control panel or the hosting company, they will have to change the default 404 to the page you created.
Now in the new 404 page, let's say you have it named 404.asp.
Within this page you would have something like this.
<% OPTION EXPLICIT Dim oldurl
oldurl = Request.ServerVariables("QUERY_STRING")
If oldurl = "http://www.oldsite.com/old-page.html" Then Response.Status = "301 Moved Permanently" Response.addheader "Location", "http://www.newsite.com/new-page.html" Response.End End If %>
Oh, check this thread also. [webmasterworld.com...] Now this isn't tested, but it should work.
Regarding the original question, what is the .htaccess equivelant for doing 301 redirects? You manage this from the IIS console. You can select a file or folder, and then specify the new location and whether or not this is a permanent or temporary redirect.
Not that this helps you in a shared hosting environment :)