生成动态子域

时间:2018-09-18 04:08:46

标签: dynamic subdomain

我愿意生成动态子域,以便为客户提供个性化的url,但它应该为所有URL打开相同的(动态)页面。

    e.g. www.max.juniferpharma.in

我用一些.htaccess提示生成了它,但是它似乎不起作用。

我的网址:http://juniferpharma.in/

我添加了A条记录:

Host - * Points to - my ip address TTL - 7200

我的.htaccess文件看起来像这样:

    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^www.juniferpharma.in
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (.*) http://juniferpharma.in/$1 [R=301,L]

    RewriteCond %{HTTP_HOST} ^juniferpharma\.in$
    RewriteCond %{REQUEST_URI} !^/yourwebsite_folder/
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (.*) /yourwebsite_folder/$1

    RewriteCond %{HTTP_HOST} ^(^.*)\.yourwebsite.com
    RewriteCond %{REQUEST_URI} !^/yourwebsite_folder/
    RewriteCond %{REQUEST_URI} !^/\.well-known/acme-challenge/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/cpanel-dcv/[0-9a-zA-Z_-]+$
    RewriteCond %{REQUEST_URI} !^/\.well-known/pki-validation/[A-F0-9]{32}\.txt(?:\ Comodo\ DCV)?$
    RewriteRule (.*) /yourwebsite_folder/$1

请帮助我解决此问题。期待。

0 个答案:

没有答案