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

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

问题描述

我试图让我的多功能配置正常工作,而我正在努力的第一个障碍,我想要我的sites.php将请求重定向到我的两个测试站点文件夹之一。我似乎不了解如何使用这个数组?



因为我正在使用Xampp安装我的请求看起来像这样。





其中sitename是我的网站项目,本地将被称为




  • c:\xampp\htdocs\sitename



我想实现一个重定向器,像




  • c:\xampp\htdocs\sitename\\\
    ormal ...

  • c:\xampp\ htdocs\sitename\mobile ...



使用sites.php示例(如下所示)




  • $ sites = array(

  • 'devexample.com'=>'example.com',

  • 'localhost.example'=>'example.com',

  • );



我看不到我如何解释我的地址。
ie





进入sites.php文件
ie




  • $ sites = array(

  • 'localhost.mobile'=>'mobile',

  • 'localhost'=>'normal',

  • );



谢谢..
ps这与我最近的另一个问题相似,但是由于关于sites.php不是drupal multifolder布局,因此不同。

解决方案

相信我已经找到了这个答案,并且在Windows安装程序中编辑hosts文件,以使Web地址重定向到127.0.0.1,以便由本地Web服务器拾取。那么drupal site.php可以使用新的网络名称来实现其重定向。



我认为这是树木问题的一部分。 / p>

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?

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

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

  • c:\xampp\htdocs\sitename

I want to implement a redirector something like

  • c:\xampp\htdocs\sitename\normal...
  • c:\xampp\htdocs\sitename\mobile...

using the sites.php example (shown here)

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

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

into the sites.php files i.e.

  • $sites = array(
  • 'localhost.mobile' => 'mobile',
  • 'localhost' => 'normal',
  • );

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

解决方案

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重定向本地主机请求的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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