- Moderator
- #1
Well, after some searching, I figured out how to do this.
I've been running DotNetNuke (which I *REALLY* like), but I was having some issues... see, DNN installed under a virtual directory /home and that was fine, until I started playing with some subdomains. In other words, it worked fine with a redirect...
HOWEVER, when I added a sub-domain....
and
... that redirect no longer worked. I needed to do some stuff with the HTTP headers. Here's what I did.
Since DNN takes care of the hosts (it calls it "portals"), this works great, even though both are essentially redirecting to the exact same location.
HOWEVER, you could also use this to redirect to regular pages... for example
support.mydomain.com --> foo.mydomain.com -->
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg
I've been running DotNetNuke (which I *REALLY* like), but I was having some issues... see, DNN installed under a virtual directory /home and that was fine, until I started playing with some subdomains. In other words, it worked fine with a redirect...
Code:
<%
Response.Redirect ("[URL unfurl="true"]http://www.mydomain.com/home")[/URL]
%>
HOWEVER, when I added a sub-domain....
and
... that redirect no longer worked. I needed to do some stuff with the HTTP headers. Here's what I did.
Code:
<%@ Language=VBScript %>
<%
foo = Request.ServerVariables("HTTP_HOST")
Select Case foo
Case "[URL unfurl="true"]www.mydomain.com"[/URL]
Response.Redirect ("[URL unfurl="true"]http://www.mydomain.com/home")[/URL]
Case "support.mydomain.com"
Response.Redirect ("[URL unfurl="true"]http://support.mydomain.com/home")[/URL]
Case Else
Response.Write "I'm not sure where you want to go.... <a href='[URL unfurl="true"]http://www.mydomain.com'>Try[/URL] This instead</a>"
End Select
%>
Since DNN takes care of the hosts (it calls it "portals"), this works great, even though both are essentially redirecting to the exact same location.
HOWEVER, you could also use this to redirect to regular pages... for example
support.mydomain.com --> foo.mydomain.com -->
Just my 2¢
"What the captain doesn't realize is that we've secretly replaced his Dilithium Crystals with new Folger's Crystals."
--Greg