[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 ;) 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:
pico /usr/local/apache/conf/httpd.conf Search for something like that: http://www.montadaphp.net/attachment...tachmentid=281 Where you should replace: Code:
ServerAlias montadaphp.net www.montadaphp.net Code:
ServerAlias montadaphp.net www.montadaphp.net *.montadaphp.net * Then execute this command in Shell window: Code:
pico /var/named/montadaphp.net.db Code:
*.montadaphp.net. IN A 66.66.66.66 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:
RewriteEngine On Done waiting for comments and questions :) Regards Mahmoud |
this is a tottally awesome article, im deffinately going to use it!
A big thanks :), this will deffinately aid me. |
wow! excellent article.
Thanks a lot! |
Thank you very much! This works great ;).
|
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 . |
Quote:
|
is there a way to have them setup a image gallery ? i would love to do this ?
|
I couldn't get this to work on my VPS
|
I'm going to give this a try on our new forum
thanks! |
Quote:
VHOST_TLD/conf/httpd.conf |
All times are GMT. The time now is 09:18 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2024, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|