API Questions on Kentico API.
Version 6.x > API > Subdomain woes - any ideas? View modes: 
User avatar
Member
Member
candyce - 6/26/2012 8:29:54 PM
   
Subdomain woes - any ideas?
I am recreating a website for a client using Kentico 6 and aspx templates. The client has several thousand distributors who are used to entering their distributor ID prior to the domain name, like a sub domain. For example, 12345.mydomain.com. The sub domain does not actually exist. The only reason the distributor ID is being passed like a sub domain is so it can be parsed by some JSON script on the page. The JSON script parses the URL to retrieve the distributor's ID number and looks up the distributor's name in a database maintained by a 3rd party application. The distributor ID has to be tracked in the Kentico system because it is used for placing orders in a 3rd party shopping cart.

The distributors are not in the Kentico database as users. Distributor data is maintained by a 3rd party application.

Kentico allows you to create licenses for sub domains if the page content stays the same. I received some code from tech support to create a license for 12345.mydomain.com. The license is created, but using the URL still doesn't work. However, this isn't a good solution because I would have to create several thousand licenses!

So, my next idea was to create a new application, using a different domain name not used by Kentico CMS. I can run the code to parse the URL and get the distributor's name, but how can I get the distributor's name and ID into the Kentico CMS pages? I tried saving it to a session variable, but because I am doing a redirect the variable is deleted.

I will appreciate any ideas you have. Telling the client they have to change the way their distributors enter the URL is not an option.


User avatar
Member
Member
DahlinDev - 6/26/2012 9:46:35 PM
   
RE:Subdomain woes - any ideas?
Here is a thought. What if you kept the subdomain structure the same, but had this as a hosted app outside of Kentico. Then in the subdomain app you extract the Distributer Id off of the subdomain.

Now you have the Distributer Id. Redirect the user to the Kentico app and pass in the DistributerId in the querystring. In Kentico you can easily get the Id off of the querystring.


User avatar
Member
Member
candyce - 6/27/2012 11:19:40 AM
   
RE:Subdomain woes - any ideas?
That worked, thank you!