IP address in HTTP_HOST

冷暖自知 提交于 2019-12-13 02:25:21

问题


I have a drupal site where I use the domain access module that works using inbound HTTP_HOST variable.I have to create some subdomain's also.To make this module work properly the $_SERVER['HTTP_HOST'] variable should have the domain name in it .But I am getting the ip address of our server.So my site is not working properly.I am getting the main site.But the subdomains are not working.All are pointing to the main site.

My site is on our server and we asked our host to point our domain name to 172.XX.XXX/drupal.Our subdomains are also pointed to 172.XX.XXX/drupal. So when I type the domain name it is showing the site but the http_host has IP in it.We have a VPS host plan.What should I do to make it work properly. Please help.


回答1:


Thing looks very easy. You are just required to tell your domain host provider to point all your sub - domains to 172.xxx. ip / drupal.

some examples.

a.yourdomain.com => actuall would point to 172.xxx/drupal.

b.yourdomain.com => actuall would point to 172.xxx/drupal.

c.yourdomain.com => actuall would point to 172.xxx/drupal.

After that your domain access module would automatically take care of your sub-domain wise access to content. Note: Technically domain access module would show the content based on your current sub domain name.



来源:https://stackoverflow.com/questions/15893351/ip-address-in-http-host

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!