Forum Moderators: open
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?)
Cheers, Sam.
I've decided to simply wait for the SE to pick up the new pages then delete the old pages. I've put up a custom 404 page that refreshes after 7 seconds to the site map.
Less than ideal, but it's a new site (3 months old) in for the long haul so I'll just have to wear the delay.
It's weird working in an environment where you have such little control....
The basic plan for the 404 is this:
read requested url from query variable passed by iis for the 404
if one of your old pages, 301 redirect to new page
else
return a 404
the above presumes that you erase all your old pages so that iis will invoke your custom 404 because it cannot find the page requested.
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!
Many thanks, Sam.
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 oldurloldurl = 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.
Not that this helps you in a shared hosting environment :)