我需要创建一个子域mobile.example.com这个子域,通过目录下的移动example.com/mobile打开。
我尝试使用这样:
的RewriteCond%{HTTP_HOST} ^(WWW )?移动 .EXAMPLE .COM $
的RewriteCond%{REQUEST_URI}!^ /手机
重写规则^(。*)$ /移动/ $ 1 [L]
解决方案
创建一个子域使用htaccess是不可能的。这是一个DNS问题。你必须配置DNS的方式,为这个子域客户端请求将被发送到的您的Web服务器。
I need to create a subdomain mobile.example.com that this subdomain to open through directory "mobile" example.com/mobile.
I try to use so:
RewriteCond %{HTTP_HOST} ^(www.)?mobile.example.com$
RewriteCond %{REQUEST_URI} !^/mobile
RewriteRule ^(.*)$ /mobile/$1 [L]
解决方案
Creating a subdomain using htaccess is impossible. it's a DNS issue. You'll have to configure DNS in a way that client requests for this sub domain will be send to your web server.