自定义域名映射到用户配置文件.

2022-01-04 00:00:00 php dns subdomain

目前,用户个人资料的格式为 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:

如何让PHP创建子域自动为每个用户?

代码点火器:

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

Zend 框架:

Zend 框架中子域重定向的查询

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

Drupal:

http://drupal.org/node/146344

相关文章