Print Page | Close Window

prevent direct linking

Printed From: Web Wiz Forums
Category: Web Wiz Web App Support Forums
Forum Name: Web Wiz Forums
Forum Description: Support forum for Web Wiz Forums application.
URL: https://forums.webwiz.net/forum_posts.asp?TID=5065
Printed Date: 02 April 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: prevent direct linking
Posted By: Badaboem
Subject: prevent direct linking
Date Posted: 16 August 2003 at 4:57am

Is there an easy way to prevent direct linking to uploads in the forum?

It's an increasing problem on my site.




Replies:
Posted By: ctscott
Date Posted: 16 August 2003 at 8:33am

i haven't used the following code in a forum environment but i have used it elsewhere and i imagine the code could be improved upon.

I put it in the global.asa file which would reside in your web root directory.  on session start the global.asa should fire up and execute the code.

Sub Session_OnStart

' Make sure that new users start on the correct  page of default.asp...Can't jump into middle of site

startPage = "default.asp"

currentPage = Request.ServerVariables("SCRIPT_NAME")

' Do a case insensitive compare, and if they don't match, send the user to the start page.

If strcomp(currentPage,startPage,1) Then Response.Redirect("http://www.mywebsite.com/" & startPage)

End If

END SUB




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net