Forum Moderators: open
Will someone here kindly direct me to such a code snippet?
thanks much
Culling from elsewhere this is as far as I can get
<script language="vbscript" runat="server">sub Session_OnStart
dim remote_agent
remote_agent = request.ServerVariables("HTTP_USER_AGENT")
If remote_agent!= ^Mozilla/5.0.*$
Then Response.Redirect("http://mysubdomain.example.com/tryfirefox.asp")
End If
end sub
</script>
this
^Mozilla/5.0.*$ is straight from my .htaccess as I don't know the asp equivalent for "begins with" (^) and "ends with anything" (.*$). I also assumed that != was "does not equal"
can "Response.Redirect" point to a document instead of a full url?
thanks even more
[edited by: Xoc at 7:05 am (utc) on April 26, 2005]
[edit reason] Use example.com for examples [/edit]
remote_agent = Request.ServerVariables("HTTP_USER_AGENT")
If InStr(1, remote_agent, "Mozilla/5.0.") = 0 Then
Response.Redirect "http://mysubdomain.example.com/tryfirefox.asp"
Else
' Found something close to Mozilla/5.0.*
End If
If you absolutely require the wildcard search then look into a regular expression.
[edited by: Xoc at 7:05 am (utc) on April 26, 2005]
[edit reason] Use example.com for examples [/edit]