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: Use parameter as a sub-domain. Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
Yatin
Groupie
Groupie


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

Hi,

I am looking for a solution to have my first parameter value as a sub-domain. Let me explain you my exact requirement may be 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 to use Value1 as a subdomain and rest of the parameters as html pages. The reason to have folder is may be in future i want to create some sub-domains physically on the server and that time both will conflict, the one which i created physically and other one which i created through url re-writing.

Thanks
Yatin
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:31am | IP Logged Quote Yatin

I did one type mistake

Now what i want
http://value1.sitename.com/Folder/
http://value1.sitename.com/Folder/Value2.html
http://value1.sitename.com/Folder/Value2/Value3.html
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: 7559
Posted: 07 August 2008 at 7:36pm | IP Logged Quote Lexey

RewriteCond Host: ([^.]+)\.sitename\.com
RewriteRule /Folder/(?:([^/?]+)(?:/([^/?]+))?\.html)? /Folder/index.asp\?str1=$1(?2&str2=$2(?3&str3=$3:):) [I,L]
Back to Top View Lexey's Profile Search for other posts by Lexey
 
Yatin
Groupie
Groupie


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

Hi Lexey,

I copied the suggested rule by you in the httpd.ini file and then tried to open this url which supposed to be working if everything would be fine.
http://value1.sitename.com/value2/value3.html

"No web site is configured at this address" message appeared.

Do i need to create sub domain manually?

Also i have checked the IIS log file and httpd error file but nothing was there with reference to my test url that i have checked.

Few more thing:
I am using version 2.0 and my website is on shared web server. May be this will help.

Please suggest.
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: 7559
Posted: 09 August 2008 at 11:49am | IP Logged Quote Lexey

You either need to add value1.sitename.com to a bindings list of an IIS web site running your application or to make this web site a "default" one (i.e. add wildcard mapping to its bindings).
Back to Top View Lexey's Profile Search for other posts by Lexey
 
Yatin
Groupie
Groupie


Joined: 09 July 2007
Online Status: Offline
Posts: 44
Posted: 11 August 2008 at 12:20am | IP Logged Quote Yatin

Hi Lexey,

As per you there are two possibilities to get desired result i.e.,
1) create sub-domains for all values that i want to be in sub-domains form.
2. Wildcard mapping - Is it at the server level or through re-write rule? please explain.

In my requirement, I want this dynamically so that what ever i pass in Value1 that will be treated as sub-domain and rest of the parameter values will work as normal. I really looking for a solution in which no need to create sub-domains at server level because that will be too hack tic for me as i am going to have more 200 sub-domains if this is possible.

Looking forward to hear that it is possible. I will be very greatful to you.

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: 7559
Posted: 11 August 2008 at 12:15pm | IP Logged Quote Lexey

Quote:
2. Wildcard mapping - Is it at the server level or through re-write rule? please explain.


You need to alter IIS web site's setting (site bindings list). This could be done with the help of IIS management console (MMC snap-in).
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