[英]How to show content of all sub-directory in sub-domain for all my user on the site [htaccess]?
I would show the content of sub-directory in a sub-domain generate with htaccess. 我将使用htaccess显示子域中子目录的内容。 Practically I must create a sub-domain for all user that register on my website
实际上,我必须为在我的网站上注册的所有用户创建一个子域
Example of my site web example.com: 我的网站web example.com示例:
/index.php
user1/
user2/
user3/
Obviously the url are now: 显然网址现在是:
example.com/user1/
example.com/user2
etc...
But I would show in the browser user1.example.com
, user2.example.com
, etc... without change whenever the file .htaccess
但是我会在浏览器中显示
user1.example.com
, user2.example.com
等等......每当文件.htaccess
没有改变
Thank you all! 谢谢你们!
Check this rewrite in top of your .htaccess file 在.htaccess文件的顶部检查此重写
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(.*)\.example\.com
RewriteRule ^(.*)$ http://example.com/%1/$1 [L]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.