如何保养magento [英] How to put magento in maintenance

查看:90
本文介绍了如何保养magento的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否可以将magento网站置于维护标记下,以便访客获得有关该网站正在建设中的消息? 我在管理区域中找不到此设置.

Is it possible to put a magento site under an maintenance flag so that visitors will get a message that the site is under construction? I can't find this setting in the admin area.

其他解决方案也将受到欢迎.

Another solution will also be welcome.

任何帮助将不胜感激.

谢谢.

推荐答案

我经常使用它. http://inchoo.net/ecommerce/magento/maintenance-mode-in- magento/

重要的部分是:

打开:在根目录和第57行以上添加index.php(记住要编辑"allowed"数组以包含您希望能够访问该站点的IP);

Open: index.php in root and above line 57 add (remembering to edit the ‘allowed’ array to contain the IP’s you want to be able to access the site);

$ip = $_SERVER['REMOTE_ADDR'];
$allowed = array('1.1.1.1','2.2.2.2'); // these are the IP's that are allowed to view the site.

然后更改行

if (file_exists($maintenanceFile)) {

if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {

这篇关于如何保养magento的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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