将 url 从子目录重写为子域
如何使用 .htaccess 重定向 url?
实际网址是 www.mywebsite.com/index.php/user/john
需要转换为 john.mywebsite.com/
How to redirect the url using .htaccess?
Actual url is www.mywebsite.com/index.php/user/john
is need to convert as john.mywebsite.com/
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
在
.htaccess
中尝试以下代码:Try this code in
.htaccess
:如果您有通配符 Dns,请联系您的主机提供商/管理员。并向线路请求
服务器配置文件上的 *.yourdomain.com。
您可以在 htaccess 文件中编写自己的内容,如下所示,
If you have wildcard Dns, contact your host provider/adminisrator. And request to the line
*.yourdomain.com on server configuration file.
You can write your self on your htaccess file as following,