如何使用htaccess的创建一个子 [英] How to create a subdomain using htaccess
本文介绍了如何使用htaccess的创建一个子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要创建一个子域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.
这篇关于如何使用htaccess的创建一个子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文