Drupal 7,尝试使用 Site.php 重定向 localhost 请求 [英] Drupal 7, trying to use Site.php to redirect localhost requests

查看:13
本文介绍了Drupal 7,尝试使用 Site.php 重定向 localhost 请求的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好,我正在尝试使我的多站点配置正常工作,并且在第一个障碍中挣扎,我希望我的 sites.php 将请求重定向到我的两个测试站点文件夹之一.我似乎无法理解如何使用这个数组?

hi I'm trying to get my multisites config working, and am struggeling at the 1st hurdle I want my sites.php to redirect requests to one of my two test sites folders. I can't seem to understand how to use this array?

当我使用 Xampp 安装时,我的请求如下所示.

as I'm using an Xampp install my requests look like this.

sitename 是我的网站项目,在本地称为

where sitename is my website project and would be locally known as

  • c:xampphtdocs站点名称

我想实现类似的重定向器

I want to implement a redirector something like

  • c:xampphtdocssitename ormal...
  • c:xampphtdocssitenamemobile...
  • c:xampphtdocssitename ormal...
  • c:xampphtdocssitenamemobile...

使用 sites.php 示例(此处显示)

using the sites.php example (shown here)

  • $sites = 数组(
  • 'devexample.com' => 'example.com',
  • 'localhost.example' => 'example.com',
  • );

我不知道如何解释我的地址.即

I can't see how I can interpret my address. i.e.

进入sites.php文件即

into the sites.php files i.e.

  • $sites = 数组(
  • 'localhost.mobile' => '手机',
  • 'localhost' => '正常',
  • );

谢谢..p.s.这与我最近的另一个问题相似,但由于涉及sites.php 而不是drupal 多文件夹布局而有所不同.

thanks.. p.s. This is similar to my other recent question, but is different due to being about sites.php not drupal multifolder layout.

推荐答案

我相信我已经找到了这个问题的答案,并且它在我的 windows 安装中编辑 hosts 文件以导致一个 web 地址重定向回 127.0.0.0.1 由本地 Web 服务器获取.那么 drupal site.php 可以使用新的 web 名称来实现其重定向.

I believe I've found the answer to this, and its to edit the hosts file on my windows installtion to cause a web address to redirect back to 127.0.0.1 to be picked up by the local web server. then drupal site.php can use the new web name to effect its redirect.

我认为这是一个只见树木不见森林的问题.

I think it was one of those can't see the wood for the trees issues.

这篇关于Drupal 7,尝试使用 Site.php 重定向 localhost 请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆