PDA

View Full Version : subdomain to subdirectory


DaniAlonso
04-18-2011, 12:30 AM
I set up my site for the subdomain "blogs" work as if subdirectory "blogs ", eg:

http://blogs.mydomain.com -> http://www.mydomain.com/blogs
http://blogs.mydomain.com/images/any.jpg -> http://www.mydomain.com/blogs/images/any.jpg

All my subdomains point to the server: http://allsubdomains.itpro.es

I found this, but either not working or do not understand:
https: / / support.discountasp.net/KB/a369/how-to-redirect-a-subdomain-to-a-subdirectory.aspx

Anybody can help me?

TNX!

Joseph Jun
04-18-2011, 03:29 PM
Can you please post the code that you're using to redirect the sub-domain name request to the sub-directory so we can review?

DaniAlonso
04-19-2011, 10:03 AM
I tried everything, I even remotely connected to IIS, but have received nothing. I thought the solution may be in the web.config file, as in Apache the solution may be in the file .htaccess...

index.asp


<%
If InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("u.mydomain.com") ) > 0 Then
Response.Redirect("/u")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("blogs.mydomain.com") ) > 0 Then
Response.Redirect("/blogs")
ElseIf InStr( UCase(Request.ServerVariables("SERVER_NAME")), UCase("step.mydomain.com") ) > 0 Then
Response.Redirect("/step")
End If
%>