Click here to Skip to main content
15,919,479 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
I want to customize the domain in url based on the user requirement. That is
my main site is
and what I need is
user 1 want to load the home page by
user 2 want to load the home page by
Like this based on customer need I want to load the Home page with the customized url. Can anybody tell me how should I do this? Only one time the file is hosted to server and it will be in the directory. I only need is for example if the user need to access the home page then he/she can access it through
Updated 4-Jan-16 17:47pm

Will you own the domains and If not then there is nothing you can really do. Those are top level domains that need DNS entries for routing.

What I would recommend doing is something like
Share this answer
Yes, you can surely make it happen. User 1 will navigate to and the next will use their own (where x is the ID of the user), but only if you are willing to buy the domain name for $10+ per year. And according to me, this would be the worst way to start your business or application.[^]

What I would recommend is to use something like this, and then provide a different URL for other users, like Many services are already using this mechanism, Tumblr, Wordpress, Blogger and so on. This mechanism is known as using "sub-domains". You can access the sub-domain using PHP or any other server-side language, ASP.NET would also work![^][^]

Another way of doing the same is using the URLs, friendly URLs, and then providing the parameters to the URLs. Like, This is a very simple way of doing anything. You can create a page "session" and then fetch the parameter "user1" and load his content in it.

The methods that I have provided you with are free of cost. You can create 1000+ users and provide them a different layout, page and so on, without having to pay another fortune cookie at all.
Share this answer
Thank you, that is a good idea.. But I have read that there is another way without buying the domain name. ie adding code in web.config file.

    <rule name="Rewrite subdomains">
        <match url="^/?$" />
            <add input="{HTTP_HOST}" pattern="^(.+)\.foo\.com$" />
        <action type="Rewrite" url="{C:1}" />
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