Click here to Skip to main content
15,890,825 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All,

I am stuck in a problem.My requirement is something like this.
I have company register page in that i have a field to choose own url.Any one can choose its own url like wasif.top.com and main(domain) url is top.com.I want to add company name in main url
(domain) and there can n numbers of company with their own url.Now if a user logins in top.com then url should be companyname+"top.com".

Please suggest how to implement it without sub-domain concept .


thanks & regards
mohd wasif
Posted

1 solution

The form of URL you want, according to your example, requires sub-domain, by definition. The string in your example fully belongs to the part of the URI scheme, called "host name", which is a part of "authority". It should be clear from this:
http://en.wikipedia.org/wiki/DNS[^],
http://en.wikipedia.org/wiki/Sub-domain[^],
http://en.wikipedia.org/wiki/URI_scheme[^].

The host name, as a part of authority, is not defined by the Web site. You cannot dynamically introduce sub-domains, because it need update of DNS data and propagation of it, something which is not accessible to the Web application using those sub-domains.

Practically, you need to find some alternative forms of re-written URL. Please see:
http://en.wikipedia.org/wiki/Rewrite_engine[^],
http://msdn.microsoft.com/en-us/library/ms972974.aspx[^].

See also: http://msdn.microsoft.com/en-us/library/vstudio/cc668201%28v=vs.100%29.aspx[^].

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900