Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: Help with Subdomains Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 04 August 2008 at 12:53pm | IP Logged Quote waynem

I would like to set up a shared directory that can be used by all my subdomains (i.e. Philly.CommuterClub.org, Scranton.CommuterClub.org, forum.commuterclub.org, classifieds.commuterclub.org, etc.) so they can share common files when I use subdomain URL's.

For example, if I enter the URL this way: http://www.commuterclub.org/classifieds/ the logo on the top left displays fine, but if I enter it this way: http://classifieds.commuterclub.org/ the logo does not display because it doesn't know how to find the logo file, looking for http://classifieds.commuterclub.org/images instead of http://www.commuterclub.org/images which is where the logo file is stored.

Is there a way to do this, or will I have to replicate all the common files into each subdomain (there are a lot of them)

Thanks for any assistance you may offer.
Back to Top View waynem's Profile Search for other posts by waynem
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 04 August 2008 at 1:39pm | IP Logged Quote waynem

Just to clarify the above, the problem is I am using a common header with the path Request.ServerVariables("SERVER_NAME")/images for each subdomain so they can all share the same header file.

So I guess the question is if I can rewrite the Request.ServerVariables("SERVER_NAME") parameter to subdomain.commuterclub.org

 

Back to Top View waynem's Profile Search for other posts by waynem
 
waynem
Newbie
Newbie


Joined: 04 August 2008
Online Status: Offline
Posts: 10
Posted: 05 August 2008 at 4:12pm | IP Logged Quote waynem

Anyone have any ideas? Did I make this clear or is it confusing?
Back to Top View waynem's Profile Search for other posts by waynem
 
Yatin
Groupie
Groupie


Joined: 09 July 2007
Online Status: Offline
Posts: 44
Posted: 07 August 2008 at 2:16am | IP Logged Quote Yatin

Take one global variable called
strsiteurl = http://www.commuterclub.com
 
and then concatenate it with all image url like this
<%=strsiteurl%>/images/logo.gif instead of Request.serverVariables
Back to Top View Yatin's Profile Search for other posts by Yatin
 
Yatin
Groupie
Groupie


Joined: 09 July 2007
Online Status: Offline
Posts: 44
Posted: 07 August 2008 at 2:26am | IP Logged Quote Yatin

one typo mistake
strsiteurl = "http://www.commuterclub.com"

Can you tell me what rule you have written to achieve your desired result because i am also looking for something similar. Let me explain you my exact requirement may you can help me out.

my current three dynamic urls are
http://www.sitename.com/Folder/index.asp?str1=value1
http://www.sitename.com/Folder/index.asp?str1=value1&str2=Value2
http://www.sitename.com/Folder/index.asp?str1=value1&str2=Value2&str3=Value3

Now what i want
http://value1.sitename.com/Folder/
http://value1.sitename.com/Folder/Value2.html
http://value1.sitename.com/Folder/Value1/Value3.html

Hence i want use Value1 as a subdomain and rest of the parameter as html pages. The reason to have folder is may be my future i want to create one sub-domain physically on the server and that time both will conflict with each other.

Thanks
Yatin

Back to Top View Yatin's Profile Search for other posts by Yatin
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7598
Posted: 07 August 2008 at 7:05pm | IP Logged Quote Lexey

Quote:
So I guess the question is if I can rewrite the Request.ServerVariables("SERVER_NAME") parameter to subdomain.commuterclub.org


You can not rewrite SERVER_NAME (all IIS variables are read-only) but you can rewrite Host: header which directly affects server name. But I would not recommend you to do this since it may affect all web applications running in the same domain. Yatin's idea with the global application variable is much better.
For example, you could set some custom header with the help of ISAPI_Rewrite and use this header instead of the SERVER_NAME variable.
Back to Top View Lexey's Profile Search for other posts by Lexey
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum