Is there a different method used for windows servers? I don't have any .asp pages on my site but may eventually but for now it's plain old .html
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2669
I've been thanked 63 times.
Offline
It is possible.
I can't remember specifics.
Let us know how you administer your server. For example - if you use a web interface (like plesk or cpanal) then the method is very different from the ones you would use if you used remote desktop connections or VNC
Internet Marketing Books
Promote Yourself on Site Reference!
We use a Plesk control panel.
PHP Code
<?
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.new-url.com" );
?>
ColdFusion Code
<.cfheader statuscode="301" statustext="Moved permanently">
<.cfheader name="Location" value="http://www.new-url.com">
ASP Code
<%@ Language=VBScript %>
<%
Response.Status="301 Moved Permanently"
Response.AddHeader "Location","http://www.new-url.com/"
%>
All of those modify the headers.
I know you have .asp
Maybe the others as well.
Moderator
From: Yorkshire, UK
Registered: 2006-08-19
Posts: 2669
I've been thanked 63 times.
Offline
korat wrote:
for now it's plain old .html
So asp, php, cf, jsp etc etc etc really isn't going to help
There are two possibilities
1 - setting up IIS to redirect based on some rules or another; but i can't remember exactly how to do this
2 - telling IIS to parse .html files as either php or asp and then including one of the snippets above.
Internet Marketing Books
Promote Yourself on Site Reference!
Not sure if you have solved the issue, as it is a little older post, but perhaps this might help >>>
If you're on a windows server, you could use a custom 404.asp page to accomplish the 301's.....
At your hosting company, set the custom 404 page to for example: 404.asp
Now let's create this 404.asp...
Code:
<%@ language="VBScript" %>
<%
Dim Is301
Dim ResponseStatus
Dim SendTo
Dim QS
Dim PathInfo
Is301 = True
SendTo = "/yourhomepage"
QS = Trim("" & Request.ServerVariables("Query_String"))
If QS <> "" Then
PathInfo = Right(QS, Len(QS) - Instr(Instr(QS, Trim(Request.ServerVariables("SERVER_NAME"))), QS, "/") + 1)
Select Case LCase(PathInfo)
Case "/oldpage.htm"
SendTo = "/newpage.asp"
Case "/oldpage2.html"
SendTo = "/newpage2.asp"
Case Else
' If Right(QS, 4) <> ".asp" Then
Is301 = False
'End If
End Select
If Is301 Then
Response.Status = "301 Moved Permanently"
Response.AddHeader "Location", "http://" & Trim(Request.ServerVariables("SERVER_NAME")) & SendTo
Else
Response.Clear
Response.Status = "404 Not Found"
End If
'Response.End
End If
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
............
Put your 404 html code here
.........
</body>
</html>
It's pretty straight forward and you can add as many pages as you like. Of cos you might have to modify it a little to your needs 
Good luck!
Member
From: Pell City, Alabama USA
Registered: 2004-11-17
Posts: 2084
I've been thanked 5 times.
Offline
Its much easier to do than that.
In the control panel applet find the Icon for Internet Information Service. Double click it so that the Microsoft Management Console opens up. Find the icon for the webserver you're working with in the tree view, most likely there is only the local machine ( your server ) to deal with. In the tree under that icon, locate the icon for the website or virtual directory you want to perform the redirect on. Right click on it and find its properties, on the dialog box that appears one of the tabs is titles "Virtual Directory", go to that tab and change the radio button at the top of the page to have the third choice selected which is something like "A redirection to an URL", when you change the option the stuff in the legend below changes and you can fill that out appropriately - its pretty obvious what you put and where.
Thats all you need to do.
TombOfTheMutilated.NET - Destroying The Minds of America's Youth Since 2001
| Never |


