test

Python code posted
created at 24 Jun 11:41, updated at 24 Jun 11:42

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
        Function redirectcheck(xurl, ourl)
          'check the xurl end if exists, response.redirect with 301
          set Geturl = Server.CreateObject("ADODB.Recordset")
          Geturl.ActiveConnection = MM_connection_STRING
          query = "SELECT ID_UrlLookup, strExternalUrl, strInternalUrl FROM tblUrlLookup WHERE strExternalUrl = '"&xurl&"' OR strExternalUrl = '"&ourl&"'"
          Geturl.Source = query
          Geturl.open()
          
            if Geturl.EOF then
            'do nothing
            else
            ' response.redirect
            Response.Status="301 Moved Permanently" 
            Response.AddHeader "Location", lcase(Geturl("strInternalUrl"))
            'done? 
            end if
          
        End Function
675 Bytes in 3 ms with coderay