简体   繁体   English

如何将网址从http://www.mysite.com/mobile更改为http://mobile.mysite.com?

[英]how to change url from http://www.mysite.com/mobile to http://mobile.mysite.com?

i have a directory on my server called mobile. 我的服务器上有一个名为mobile的目录。 basically if a user is accessing my site from a mobile device it will take them to http://www.mysite.com/mobile and in directory mobile is index.php. 基本上,如果用户正在通过移动设备访问我的网站,它将带他们到http://www.mysite.com/mobile,而在移动目录中为index.php。

but i was wondering how people change the browser url address, so instead of http://www.mysite.com/mobile its http://mobile.mysite.com . 但我想知道人们如何更改浏览器的URL地址,因此与其使用http://mobile.mysite.com代替http://www.mysite.com/mobile

can anyone please explain/show me how i can do this. 谁能解释/告诉我我该怎么做。 thanks 谢谢

  1. You have to configure a subdomain, ie an A record with the DNS provider. 您必须配置一个子域,即使用DNS提供程序的A记录。 If you have just one server/IP, point this A record to the same. 如果只有一个服务器/ IP,则将此A记录指向相同的位置。
  2. Configure a new virtual host on your webserver to respond to the A record you just created. 在Web服务器上配置一个新的虚拟主机,以响应刚创建的A记录。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 将http://www.mysite.com/mypage.asp重写为http://www.mysite.com/ - Rewriting http://www.mysite.com/mypage.asp to http://www.mysite.com/ 地址栏上的固定网址-仅显示基本网址http://www.mysite.com - fixed url on address bar - show only base url http://www.mysite.com (如何修复)网站URL显示为cdn.mysite.com,而不是www.mysite.com - (How to Fix) Site URL shows as cdn.mysite.com instead of www.mysite.com 为什么会出现在某些站点上,您可以在http://mysite.com下登录,然后转到http://www.mysite.com却没有登录? - how come on some sites you can log in under http://mysite.com and then when you go to http://www.mysite.com you're not logged in? 如何获得像www.facebook.com/mysite这样的Facebook网址 - How to get a facebook url like www.facebook.com/mysite 如何确保我的网站始终以www.mysite.com而不是以mysite.com的身份打开-这弄乱了我的Google OpenID登录名? - How can I ensure my website always opens as www.mysite.com and not mysite.com - this messed up my Google OpenID logins? Magento:www.mysite.com/?SID=“number”出现在一个Google网址中 - Magento: www.mysite.com/?SID=“number” is appearing in one of the google urls 如何在localhost:3000上演示网站,但使地址栏显示http://mysite.com? - How can I demo a website at localhost:3000 but make the address bar show http://mysite.com? 我该如何在codeigniter上使用此网址(ca.mysite.com)? - how can i do this url (ca.mysite.com) on codeigniter? 如何在Joomla中将URL路径从www.website.com/v1更改为www.website.com - How to change URL path from www.website.com/v1 to www.website.com in Joomla
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM