%@ EnableSessionState=False Language=VBScript%> <% dim host, conn, domainDB, checkSQL, listdomain dim direct, otherdomain '########### Domain Redirection via Database ############### '# Script copyright Adam Ware at Designbliss.com.au # '# You can use this script freely aslong as the copyright # '# information stays the same.... Also feel free to change # '# and modife the script, you can add your name to it -but # '# please email at info@designbliss.com.au if you do # '########################################################### ' Set the following thing 'Change the below to URL to send the Visitor if no domain are found the database otherdomain = "http://www.Bankruptcy-Divorce.com/A-Manuals.htm" '##################### thats it ################################# 'a DSN-less connection string below Set domainDB = Server.CreateObject("ADODB.Connection") conn = "DRIVER={Microsoft Access Driver (*.mdb)}; " conn=conn & "DBQ=" & Server.MapPath("domain.mdb") domainDB.Open conn ' we get the url that the visitor used host=lcase(request.servervariables("HTTP_HOST")) ' check and see if its in the database checkSQL = "select * from redirect where domain='"&host&"'" set listdomain = domainDB.execute(checkSQL) ' if the domain is not in the database we direct them to a default page or site if listdomain.EOF then ' close things off domainDB.close set domainDB = nothing response.redirect""&otherdomain&"" end if direct = listdomain("redirect") SELECT CASE host CASE ""&host&"" ' close things off domainDB.close set domainDB = nothing response.redirect ""&direct&"" END SELECT %>