Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Redirect

Status
Not open for further replies.

shaneh0

Programmer
Nov 4, 2002
27
US
Hi,

Our intranet has always been at
Now I want to change it to intranet.domain.com

I've setup intranet.domain.com and it works fine, I just don't know how to redirect any requests for domain.com/intranet to intranet.domain.com.

Thanks for youe help!
Shane
 
Add this to the start page, such as default.asp or index.asp and the user will be sent to the right page if they enter the old address.

Start of ASP code -----------

Dim strURL
strURL = lcase(Request.ServerVariables("HTTP_HOST"))

If strURL = " then
Response.redirect "End If

-------- End of ASP code -------


Hope that helps.
Free Online Security and Privacy Testing at
 
But that won't work if the user tries to go to
Try this instead assuming that there is nothing left of - in other words all the files and folders have been moved to the new server. Set up a custom 404 page on the old address which is an ASP that does the redirect to the new domain.

<%
Response.redirect &quot;%>

If the folders and files on the new server are the same as the old server then you can do a little bit of cleverness and redirect to the correct page on the new server - but I'll leave that up to you to do for fun :)

Hopefully this makes sense - it's been a long day!

Rob W
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top