自定义域名映射到用户配置文件。 [英] Custom domain name mapping to user profile.
问题描述
目前,用户个人资料的格式为website.com/username。然而,一些较重的用户希望使用自定义域名。这与Tumblr类似。用户被赋予一个username.tumblr.com的子域名,但是它们被允许使用映射到子域的外部域。在PHP中我该怎么做?允许用户使用自定义域名?
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?
非常感谢您的帮助!
推荐答案
您可以使用以下示例:
基本PHP:
CodeIgniter:
< a href =http://net.tutsplus.com/tutorials/php/basecamp-style-subdomains-with-codeigniter/ =nofollow noreferrer> http://net.tutsplus.com/tutorials/php/ basecamp-style-subdomains-with-codeigniter /
Zend Framework:
$routeitem = new Zend_Controller_Router_Route_Regex('(.*)',
array(1 => '', 'controller' => 'redir', 'action' => 'view'),
array(1 => 'hash'),
'%s'
);
Drupal:
这篇关于自定义域名映射到用户配置文件。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!