Welcome to Egypt Forums Mark forums read | Egypt Main Page
Egypt Forums
Arabic Movies



Articles Thread, [How-to] Unique subdomain for each member profile in vBulletin; [How-to] Unique subdomain for each member profile Hi All As for Blogs and Free hosting websites we see every user ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=6360


Reply
LinkBack (1) Thread Tools Display Modes
[How-to] Unique subdomain for each member profile
 
 
The God Father
Developer's Avatar

Reply With Quote
 
Join Date: Jul 2008
Location: NDC
Posts: 5,425
16-11-2008, 07:11 PM
 
[How-to] Unique subdomain for each member profile

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 Egypt.Com EnForum
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):
Code:
PHP Code:
pico /usr/local/apache/conf/httpd.conf
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:

Egypt.Com EnForum

Where you should replace:
Code:
PHP Code:
ServerAlias montadaphp.net www.montadaphp.net

with:
Code:
PHP Code:
ServerAlias montadaphp.net www.montadaphp.net *.montadaphp.net

then save the file and Close..


* Then execute this command in Shell window:
Code:
PHP Code:
pico /var/named/montadaphp.net.db

Add the following line anywhere in the file:
Code:
PHP Code:
*.montadaphp.net. IN A 66.66.66.66

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:
Code:
PHP Code:
RewriteEngine On
RewriteCond
%{HTTP_HOST} !^www.
RewriteCond %{HTTP_HOST} ^(.+).montadaphp.net
RewriteRule
^(.*) http://www.montadaphp.net/member.php?username=%1 [R=301,L]

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

__________________
I Love Walking In The Rain Cuz Nobody Know I'm Crying !!
 
 
 
Reply

Articles Thread, [How-to] Unique subdomain for each member profile in vBulletin; [How-to] Unique subdomain for each member profile Hi All As for Blogs and Free hosting websites we see every user ...

Short Link: http://forum.egypt.com/enforum/showthread.php?t=6360


Bookmarks

Tags
howto, member, profile, subdomain, unique


LinkBacks (?)
LinkBack to this Thread: http://forum.egypt.com/enforum/articles-f145/how-unique-subdomain-each-member-profile-6360.html
Posted By For Type Date
[REQ] [How-to] Unique subdomain for each member profile - vBTEAM Underground This thread Refback 20-11-2008 09:16 AM

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using Multiple MySQL Tables with Unique IDs, Joins and Normalization Developer Articles 0 26-11-2008 09:31 PM
ZH - Member Count On Memberslist Developer Mods for 3.7.x 0 02-11-2008 09:33 PM
VBGooglemap Member Edition Developer Mods for 3.6.x 0 29-10-2008 06:27 PM
[How-to] Unique subdomain for each member profile Developer Articles 0 10-09-2008 06:38 PM
Junior Member Noura Raslan Woman Health 2 01-05-2008 03:27 AM