Register Members List Search Today's Posts Mark Forums Read

Reply
 
Article Options
[How-to] Unique subdomain for each member profile
coderphp
Join Date: Dec 2006
Posts: 204

Egypt
by coderphp coderphp is offline 12 Aug 2007

Hi All

As for Blogs and Free hosting websites we see every user in the website given a unique subdomain, something like user.example.com, Did you ever wonder how this is done? Is the webmaster waiting for new users to activate their sub-domain manually, of course not this must be done automatically, infact automagically
in the following lines you will be learned how to do that in your website.
WARNING: The following tutorial (in Step 1) contains some slight configuration with the webserver, you should ask your webhost to do them for you, or, if you have priviliges to the server be cautious or you will put yourself in endless problems
Again if you dont know how to do that ask for a pro to do it for you.

NOTE:
1- montadaphp.net is to be replaced with your Domain name allover the tutorial.
2- 66.66.66.66 is to be replaced by your website IP (either Shared or Dedicated) allover this tutorial.


Demo:
See what this page leads to: coder.montadaphp.net
or this amine.montadaphp.net


Step 1: Server configuration:
NOTE: be sure to take a backup of the files:
/var/named/montadaphp.net.db
/usr/local/apache/conf/httpd.conf

* Execute this command using your Shell program (you can download one HERE):

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Note that the path of the file may vary accoring to ur system or config, if you dont find the file in the specified path use the command (locate httpd.conf) to find the right path for you.

Search for something like that:



Where you should replace:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

with:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

then save the file and Close..


* Then execute this command in Shell window:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Add the following line anywhere in the file:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

Save and close the file
Restart your Named & httpd services
or restart the whole webserver


Step 2: Writing .htaccess file to redirect subdomains:
Create a new file named .htaccess or edit ur existing file (if there is one) and add the following code:

Block Disabled:      (Update License Status)  
Suspended or Unlicensed Members Cannot View Code.

and upload it to your forum's root (usually public_html)

Done
waiting for comments and questions
Regards
Mahmoud
Views: 9726
Reply With Quote
Comments
  #2  
Old 24 Oct 2007, 12:54
0tolerance 0tolerance is offline
 
Join Date: Jun 2007
this is a tottally awesome article, im deffinately going to use it!
A big thanks , this will deffinately aid me.
__________________
Exasco.info - Exasco is a community that helps people, there’s no fees, just friendships.
Reply With Quote
  #3  
Old 06 Nov 2007, 18:13
Zorck Zorck is offline
 
Join Date: Jan 2003
wow! excellent article.

Thanks a lot!
Reply With Quote
  #4  
Old 06 Jun 2008, 01:35
meenstreek meenstreek is offline
 
Join Date: Jun 2007
Real name: Cody Lundquist
Thank you very much! This works great .
Reply With Quote
  #5  
Old 13 Jun 2008, 06:50
shofolofo shofolofo is offline
 
Join Date: Sep 2007
Thanks for the great article

but i have a couple of questions :
Is there a way to do this via cpanel?
as i'm not comfortable with editing server's configs .

does it have cn immediate effect?
as when i try to create a custom subdomain in cpanel it tells me that it requires some time to be activated as it will be published over DNS servers .

Last edited by shofolofo; 13 Jun 2008 at 06:59.
Reply With Quote
  #6  
Old 14 Jun 2008, 13:58
karlm's Avatar
karlm karlm is offline
 
Join Date: Jul 2006
Real name: Karl
Originally Posted by coderphp View Post
Demo:
See what this page leads to: coder.montadaphp.net
or this amine.montadaphp.net
Page cannot be found...?
Reply With Quote
  #7  
Old 08 Sep 2008, 13:14
mmoore5553 mmoore5553 is offline
 
Join Date: Aug 2008
is there a way to have them setup a image gallery ? i would love to do this ?
Reply With Quote
  #8  
Old 15 Sep 2008, 07:14
bharvey42 bharvey42 is offline
 
Join Date: Jan 2002
I couldn't get this to work on my VPS
Reply With Quote
  #9  
Old 15 Sep 2008, 07:18
Brandon Sheley's Avatar
Brandon Sheley Brandon Sheley is offline
 
Join Date: Mar 2005
Real name: Brandon
I'm going to give this a try on our new forum
thanks!
__________________
I've been offering vBulletin Support and Wordpress Optimization for 10+ years, Contact me if you have questions.
Check out The Best Forum Ever if you get bored.
Reply With Quote
  #10  
Old 07 Nov 2008, 19:16
trigxm trigxm is offline
 
Join Date: Nov 2008
Originally Posted by bharvey42 View Post
I couldn't get this to work on my VPS
If your running Plesk, you'll have to put the information in

VHOST_TLD/conf/httpd.conf
Reply With Quote
  #11  
Old 30 Nov 2008, 20:39
Gamelobby's Avatar
Gamelobby Gamelobby is offline
 
Join Date: Jul 2007
Does this still work.? (3.7x)

I think it would be great, but afraid of odd usernames screwing things up.

Ex:
~-+\username/+-~
Reply With Quote
  #12  
Old 19 Jan 2009, 15:14
AlShammari AlShammari is offline
 
Join Date: Jul 2007
this will only redirect the files with fake subdomains not real subdomains because it never been created.

but thanks coderphp for this tip.

it's greate one
Reply With Quote
  #13  
Old 18 Apr 2010, 20:17
peoplez peoplez is offline
 
Join Date: Apr 2010
hey bro, is their a way to setit up for a special user group only ?
Reply With Quote
  #14  
Old 22 Dec 2010, 18:02
final kaoss final kaoss is offline
 
Join Date: Apr 2006
Interesting idea but my concerns are does this method have an impact on SEO vs leaving the member pages as is?
Reply With Quote
  #15  
Old 09 Jan 2012, 06:30
vAsia vAsia is offline
 
Join Date: Sep 2003
How would you modify it to have forumname in subdomain?

http://yourname.com/forumdisplay.php?4, where the forum name is "money"

When you url http://money.yourname.com, the content of http://yourname.com/forumdisplay.php?4 where the forum name is "money"
Reply With Quote
Reply

Similar Article
Article Author Type Replies Last Post
Profile Gallery: Allow Users to Upload Member Profile Images calorie vBulletin 3.6 Add-ons 45 13 Jan 2008 16:18



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Article Options

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


New To Site? Need Help?

All times are GMT. The time now is 02:36.

Layout Options | Width: Wide Color: