Snitz Forums 2000
Snitz Forums 2000
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Community Forums
 Code Support: ASP (Non-Forum Related)
 Redirecting a User
 New Topic  Topic Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 October 2003 :  01:06:31  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Well, I am changing some things around on my site and the forum directory is going from siteurl/snofan to siteurl/forum. The thing is that there are a lot of posted links in the forum that refer to the old location. I am trying to think of a way so when people click the existing links to references of posts they dont get a dead link. So far I has set up a custom 404.asp page and have this code.


strBadLink = Request.QueryString
strBadLink = Replace(strBadLink, "404;", "")
strFolderFile = right(strBadLink, (len(strBadLink)-33))
strFile = right(strBadLink, (len(strBadLink)-40))
strOld = "snofan/" + strFile

if strFolderFile = strOld then
Response.Redirect "http://sf.snowmobilefanatics.com/forum/" & strFile
end if


I am getting the requested url, taking of the junk, finding the folder/file.asp combination then just finding the file. I am then comparing the old url to what the user typed in and if the two match it will forrward the user to the new url. If not it will just display the normal 404.asp error page I have set up. Problem is when I go to a link such as: http://www.snowmobilefanatics.com/snofan/topic.asp?TOPIC_ID=7533 where I have a TOPIC_ID=7533 that part is not included so it goes to topic.asp which forwards them to default.asp Anyone have any idea how I can grab the TOPIC_ID as well? I am a little stumped here. Thanks!




Erick
Snowmobile Fanatics

redbrad0
Advanced Member

USA
3725 Posts

Posted - 09 October 2003 :  08:21:56  Show Profile  Visit redbrad0's Homepage  Send redbrad0 an AOL message
Erick, why dont you just setup a virtual directory in IIS so snofan points at the same directory as forum

Brad
Oklahoma City Online Entertainment Guide
Oklahoma Event Tickets
Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 October 2003 :  08:54:16  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Well for one thing I guess, I don't want them operating out of that directory anymore. I want them to use the new one.




Erick
Snowmobile Fanatics

Go to Top of Page

dayve
Forum Moderator

USA
5820 Posts

Posted - 09 October 2003 :  10:41:14  Show Profile  Visit dayve's Homepage
I had this same issue when I wanted my forum url to change from http://www.burningsoulsforum.com/forum to http://www.burningsoulsforum.com. I did like redbrad0 suggested to you, and created virtual directory titled /forum. Quite honestly it was the best approach and after time went by, it didn't seem to matter anymore. I know this is not what you want, but for simplicity, it really is the best option IMHO.

HOWEVER, I do know that when I have used Dreamweaver for other projects, they build in routines that continually append to the request.form's and request.querystring's. It's actually a pretty cool method. I'll have to post an example later, unless you have Dreamweaver and can check it yourself.

Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 October 2003 :  11:22:41  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
I found this reference to requests.querystring... http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iisref/htm/ref_vbom_reqocqs.asp Is there anything here that can help me? I can't seem to get any of it implimented.




Erick
Snowmobile Fanatics

Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 October 2003 :  11:48:06  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Sure, post an example. I don't have dreamweaver.




Erick
Snowmobile Fanatics

Go to Top of Page

sr_erick
Senior Member

USA
1318 Posts

Posted - 09 October 2003 :  12:15:09  Show Profile  Visit sr_erick's Homepage  Send sr_erick a Yahoo! Message
Hmm, I guess the request.querystring doesnt work correctly when hitting a 404 page. If I make a folder and then a topic.asp file with the following code it would work though. I am still trying to find a way to do it with a single file instead though for everything including forum.asp, topic.asp, pop_profile.asp, etc...


<%
strBadLink = Request.QueryString
Response.Redirect "http://sf.snowmobilefanatics.com/forum/topic.asp?" & strBadLink
%>




Erick
Snowmobile Fanatics


Edited by - sr_erick on 09 October 2003 12:16:27
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Topic Locked
 Printer Friendly
Jump To:
Snitz Forums 2000 © 2000-2021 Snitz™ Communications Go To Top Of Page
This page was generated in 0.34 seconds. Powered By: Snitz Forums 2000 Version 3.4.07