Forum Moderators: phranque

Message Too Old, No Replies

Use username to create subdomains

         

abhilash0000

10:40 am on Jan 28, 2008 (gmt 0)

10+ Year Member



i just wanted to know if its possible to give a user name a page like
[username.example.com...] as his personal home page or his user page in my site

[edited by: engine at 11:16 am (utc) on Jan. 28, 2008]
[edit reason] Please use example.com [/edit]

lammert

3:54 pm on Jan 29, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Yes, this is possible. What you need to do is add wildcards to your DNS server, and to a virtualhost section of your httpd.conf. I have a similar setup for one of my domains. I have wildcard subdomains that can be accessed via subdomain.example.com.

In the DNS server, I have added the following two records:

example.com. 86400 IN A 111.222.111.222
*.example.com. 86400 IN CNAME example.com.

You need the following setting in Apache httpd.conf:

<VirtualHost 111.222.111.222:80>
ServerName www.example.com
ServerAlias *.example.com
# other settings
</VirtualHost>

abhilash0000

8:13 pm on Jan 29, 2008 (gmt 0)

10+ Year Member



thanks a lot for u r reply ill check it soon is this the way blogger.com operates they give under the subname rite...?

phparion

4:44 am on Jan 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



how about doing it in real time on a shared hosting? you might have seen on many social networking websites, that as soon as you register you get your homepage url which is a subdomain of the site based on your username.

abhilash0000

10:00 am on Jan 31, 2008 (gmt 0)

10+ Year Member



ya i have actually worked on it but i was informed tat if u divide u r domain name in such way u mite decrease the site ranking tats y i asked is this is the way blogs ne blogger.com is created

phparion

10:39 am on Jan 31, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



did you check the page rank of hi5, myspace and multiply.com kinda websites?

abhilash0000

11:56 am on Jan 31, 2008 (gmt 0)

10+ Year Member



ya i checked them so its not a problem if i give out blogs or userpages on the subdomain names is it?

jdMorgan

5:05 am on Feb 1, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No it's not a problem. And the main domain benefits from all those 'home page' links in each subdomain, too. :)

For more info on this subject see the "Mass Virtual Hosting" section in the Apache URL Rewriting Guide [httpd.apache.org], and search this forum for "rewrite subdomains to subdirectories" and similar phrases.

Jim

phparion

2:52 pm on Feb 3, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



thank you J, I found the answer to my question from the link you had given. I also found the solution of a problem this forum has :P

visit [webmasterworld.com...] and [webmasterworld.com...] and you will see the first shows 404 error :)