Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - prevent direct linking
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

prevent direct linking

 Post Reply Post Reply
Author
Badaboem View Drop Down
Senior Member
Senior Member


Joined: 12 April 2002
Location: Netherlands
Status: Offline
Points: 600
Post Options Post Options   Thanks (0) Thanks(0)   Quote Badaboem Quote  Post ReplyReply Direct Link To This Post Topic: prevent direct linking
    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.

Back to Top
ctscott View Drop Down
Senior Member
Senior Member


Joined: 27 May 2003
Location: United States
Status: Offline
Points: 246
Post Options Post Options   Thanks (0) Thanks(0)   Quote ctscott Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.