Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

This type of auto redirecting doesn

Status
Not open for further replies.

RushiShroff

Programmer
Jan 23, 2002
216
IN
This type of auto redirecting doesnt seem to be working.

Code : Global.asa
Code:
Sub Session_OnStart
	' Make sure that new users start on the correct
    ' page of the ASP application.

    ' Replace the value given to startPage below
    ' with the virtual path to your application's
    ' start page.
    
    ' Do a case-insensitive compare, and if they
    ' don't match, send the user to the start page.

    	MyHomePage="/index.htm"
	RequestPage=Request.serverVariables("SCRIPT_NAME")
	If not (STRCOMP(MyHomePage,RequestPage,vbTextCompare)=0) THEN 
		Response.Redirect MyHomePage
	End If
End Sub
 
Got the answer..
Apply this script rather in global.asa
Code:
Sub Session_OnStart	
	if Request.serverVariables(&quot;Script_Name&quot;)<> &quot;OFY/asp/index.asp&quot; then
		if Request.serverVariables(&quot;Http_referer&quot;)=&quot;&quot; then
			response.redirect &quot;../index.htm&quot;
		End If	
	End If
End Sub

Here in root index.htm is default home page which does nothing except redirecting the user to asp/index.asp which is actual home page through Javascript..

Got that ???!!!
Rushi@emqube.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top