Posts: 115
Location: Tampa Bay, FL - USA
|
I have been programming in PHP for about five years now and for the first time having to do some ASP programming. I figured since I am proficient, "How hard can it be?" ...Apparently it can be very hard. I know way less ASP then I thought I did ;-)
Anyway, here's my problem. I have several domains. All the pages for the domain names sit in the same folder regardless of domain name. The content for all the domain names is the same. However , I want to use Request.ServerVariables("HTTP_HOST") to check which domain name is being accessed and then display a different template based on that domain name.
Here's the script I have written:
<% If Request.ServerVariables("HTTP_HOST") = "domain-1.com" Then %><!--#include virtual="/lib/inc/template_domain-1.asp" --> <% ElseIf Request.ServerVariables("HTTP_HOST") = "domain-2.com" Then %><!--#include virtual="/lib/inc/template_domain-2.asp" --> <% Else %><!--#include virtual="/lib/inc/template_default.asp" --> <% End If %>
To me this makes sense. However what happens is, nomatter what the domain is it always includes template_default.asp. I added <%= Request.ServerVariables("HTTP_HOST") %> to the body of the test page to make sure that the domain was being returned correctly and it was. It does read the domain name correctly, but it still loads the incorrect template.
Any ideas?
|