SI
SI
discoversearch

We've detected that you're using an ad content blocking browser plug-in or feature. Ads provide a critical source of revenue to the continued operation of Silicon Investor.  We ask that you disable ad blocking while on Silicon Investor in the best interests of our community.  If you are not using an ad blocker but are still receiving this message, make sure your browser's tracking protection is set to the 'standard' level.
SI - Site Forums : Silicon Investor - Legacy Interface Discussion (2004-2011)

 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext  
To: SI Bob who wrote (1482)9/28/2004 12:28:24 AM
From: Jeffrey S. Mitchell  Read Replies (1) of 6035
 
Regarding redirecting old URLs...

I'm not sure what error gets generated when trying to access an old board or message, but, for sake of argument, say it's a 404. All you need to do is write a few lines of code in the custom error file specified in the default web site properties (e.g. SI_404.htm) that parses and redirects to a new file.

More specifically...

First you chop off the error code (e.g. "404;") that precedes the URL passed to the custom error file. Then you append the variable to the updated URL.


strOld_SI_URL = Mid(lcase(Request.Querystring),5)

If Mid(strOld_SI_URL,1,55) = "http: //www.siliconinvestor. com/stocktalk/readmsg.aspx?msgid=" then
strSI_ID = Mid(strOld_SI_URL,56)
Response.Redirect "/readmsg.aspx?msgid=" & strSI_ID
End If

If Mid(strOld_SI_URL,1,63) = "http: //www.siliconinvestor. com/stocktalk/subject.aspx?subjectid=" then
strSI_ID = Mid(strOld_SI_URL,64)
Response.Redirect "/subject.aspx?subjectid=" & strSI_ID
End If


etc.

- Jeff
Report TOU ViolationShare This Post
 Public ReplyPrvt ReplyMark as Last ReadFilePrevious 10Next 10PreviousNext