[英]How do I redirect drupal to another site when in maintenance mode
hopefully you can help me; 希望你能帮助我;
I'm setting up a new Drupal 7 environment and want to setup two subdomains which are independent from Drupal itself. 我正在设置一个新的Drupal 7环境,并想要设置两个与Drupal本身独立的子域。 One for the pre-launch and another for when Drupal goes into maintenance mode.
一个用于预启动,另一个用于Drupal进入维护模式。
Is there a way to do this other than using a .htaccess file? 除了使用.htaccess文件之外,还有其他方法吗? ie a way of doing it using Drupal itself, so that when I want to put the file into maintenance mode, I can do it quickly without having to use a .htaccess file to do it.
即使用Drupal本身进行处理的一种方式,这样当我要将文件置于维护模式时,可以快速进行处理而不必使用.htaccess文件进行处理。
So essentially, I want to enable the maintenance mode in Drupal 7 and then for everyone who should currently see the page in Drupal which says that the website is down for maintenance, is redirected to a sub-domain. 因此,从本质上讲,我想在Drupal 7中启用维护模式,然后将当前应该在Drupal中看到页面的所有人(该网站说维护该网站已关闭)重定向到一个子域。
Is this possible, and if it is, what do I need to do to do it? 这是否可能,如果可能,我需要做些什么?
You can add a template file to you theme for the maintenance page - maintenance-page.tpl.php - and write into it something like: 您可以将模板文件添加到维护页面的主题-maintenance-page.tpl.php-并写入如下内容:
<?php
drupal_goto('https://www.google.com', 307);
Just replace the google URL with your subdomain's URL. 只需将Google URL替换为您的子域的URL。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.