Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Custom domain name mapping to user profile.

Tags:

php

subdomain

dns

Currently, user profiles are in the format of website.com/username which is fine. However, some heavier users wish to use custom domain names. This is similar to Tumblr. Users are given a subdomain of username.tumblr.com but they are allowed to use an external domain which gets mapped to the subdomain. How do I go about this in PHP? Allowing users to use custom domain names?

Thanks so much in advance for the help!

like image 696
Giles Van Gruisen Avatar asked Nov 22 '25 22:11

Giles Van Gruisen


1 Answers

You can use the following examples:

Basic PHP:

How to let PHP to create subdomain automatically for each user?

CodeIgniter:

http://net.tutsplus.com/tutorials/php/basecamp-style-subdomains-with-codeigniter/

Zend Framework:

Query regarding subdomain redirection in Zend Framework

$routeitem = new Zend_Controller_Router_Route_Regex('(.*)',
                    array(1 => '', 'controller' => 'redir', 'action' => 'view'),
                    array(1 => 'hash'),
                    '%s'
    );

Drupal:

http://drupal.org/node/146344

like image 172
camilo_u Avatar answered Nov 24 '25 14:11

camilo_u



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!