Redirecting To Home Page

Results 1 to 3 of 3

Thread: Redirecting To Home Page

  1. #1
    Join Date
    Dec 1969

    Default Redirecting To Home Page

    How can we redirect a user to home page if he does not start with the home page?<BR>I am writing following code in global.asa file and storing with other asp pages:<BR><BR>&#060;script language="vbscript" RUNAT=server&#062;<BR>sub Session_OnStart<BR> myhomepage="pass.asp"<BR> reqpage=Request.ServerVariables("SCRIPT_NAME")<BR> if not (strcomp(myhomepage,reqpage,vbtextxompare)=0) then<BR> Response.Redirect "pass.asp" <BR> end if<BR> <BR>end sub<BR>&#060;/script&#062; <BR><BR>I can see the URL (home page) flashing repeatedly but it never redirect to home page.

  2. #2
    Lurker Guest

    Default Arse about tit

    Do it like this:<BR><BR>On your &#039;Home Page&#039; do this:<BR>Set session("BeenHere") = True<BR><BR>On all other pages do this:<BR>If Not(Session("BeenHere")) Then<BR>Response.Redirect "MyHomePage.Asp"<BR>End If

  3. #3
    Join Date
    Dec 1969

    Default RE: Arse about tit

    Thanks for ur prompt reply but still i am getting this error on my home page:<BR>Microsoft VBScript runtime error &#039;800a01a8&#039; <BR><BR>Object required: &#039;session&#039; <BR><BR>Please help me to find out why?<BR>with regards<BR>Anurag Verma

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts