vBulletin Mods

The Official vBulletin Modifications Site
https://www.vbulletin.org/forum/showthread.php?t=155054

[How-to] Unique subdomain for each member profile
by coderphp
12 Aug 2007 21:13

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:

http://www.montadaphp.net/attachment...tachmentid=281

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

0tolerance 24 Oct 2007 11:54

this is a tottally awesome article, im deffinately going to use it!
A big thanks :), this will deffinately aid me.

Zorck 06 Nov 2007 17:13

wow! excellent article.

Thanks a lot!

meenstreek 06 Jun 2008 00:35

Thank you very much! This works great ;).

shofolofo 13 Jun 2008 05:50

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 .

karlm 14 Jun 2008 12:58

Quote:

Originally Posted by coderphp (Post 1316108)
Demo:
See what this page leads to: coder.montadaphp.net
or this amine.montadaphp.net

Page cannot be found...?

mmoore5553 08 Sep 2008 12:14

is there a way to have them setup a image gallery ? i would love to do this ?

bharvey42 15 Sep 2008 06:14

I couldn't get this to work on my VPS

Brandon Sheley 15 Sep 2008 06:18

I'm going to give this a try on our new forum
thanks!

trigxm 07 Nov 2008 18:16

Quote:

Originally Posted by bharvey42 (Post 1622433)
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

Gamelobby 30 Nov 2008 19:39

Does this still work.? (3.7x)

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

Ex:
~-+\username/+-~

AlShammari 19 Jan 2009 14:14

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

peoplez 18 Apr 2010 19:17

hey bro, is their a way to setit up for a special user group only ?

final kaoss 22 Dec 2010 17:02

Interesting idea but my concerns are does this method have an impact on SEO vs leaving the member pages as is?

vAsia 09 Jan 2012 05:30

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"


All times are GMT. The time now is 22:59.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2018, vBulletin Solutions Inc.
Copyright ©2001 - , vbulletin.org. All rights reserved.