I tried this but EVERY request forwards to 8080.
<%
select case Request.QueryString("")
case "http://carefreecomputing.net"
If Request.ServerVariables("SERVER_PORT")=80 then
strSecureURL = "https://"
strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
strSecureURL = strSecureURL & Request.ServerVariables("URL")
if request.Querystring <> "" then
strSecureURL = strSecureURL & "?" & request.Querystring
end if
Response.Redirect strSecureURL
End If
case "http://othersite.com"
response.redirect("http://carefreecomputing.net:8080")
case else
response.redirect("http://carefreecomputing.net:8080")
end select
%>
The reason for the if/then routine is to allow indexing. Indexing will not occur with a secured site, this routine SHOULD redirect a browser to use SSL and allow an indexing spider to use port 80.
Using this code has the same effect (so it's not in the spider routine)<%
select case Request.QueryString("")
case "http://carefreecomputing.net"
Response.Redirect("https://carefreecomputing.net")
case "http://othersite.com"
response.redirect("http://carefreecomputing.net:8080")
case else
response.redirect("http://carefreecomputing.net:8080")
end select
%>
However, since I haven't got the bugs out of the querystring object, it's a moot point. It looks like QueryString comes up empty all the time, regardless of what's typed in the browser address bar.
Edit
Figured it out using a different approach.
Instead of QueryString, I did this:
<% select case Request.ServerVariables("server_name")
case "carefreecomputing.net"
If Request.ServerVariables("SERVER_PORT")=80 then
strSecureURL = "https://"
strSecureURL = strSecureURL & Request.ServerVariables("SERVER_NAME")
strSecureURL = strSecureURL & Request.ServerVariables("URL")
if request.Querystring <> "" then
strSecureURL = strSecureURL & "?" & request.Querystring
end if
End If
response.redirect("https://carefreecomputing.net/index.htm")
case "othersite.com"
response.redirect("http://carefreecomputing.net:8080")
case else
response.redirect("https://carefreecomputing.net/index.htm")
end select%>