题
是否可以将 magento 站点置于维护标记下,以便访问者收到该站点正在建设中的消息?我在管理区域找不到此设置。
另一种解决方案也将受到欢迎。
任何帮助,将不胜感激。
谢谢。
解决方案
我经常使用这个。 http://inchoo.net/ecommerce/magento/maintenance-mode-in-的magento /
重要的部分是:
打开:的index.php在根和上述线57的附加(记住要编辑的“允许的”阵列以包含IP是你希望能够访问该站点);
$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维护模式,只是在你的Magento商店的根目录中创建空的 maintenance.flag 文件。
这就是我添加到索引,以便能够继续从不同的IP工作:
//EGS to show a maintenance page but be able to work
$ip = $_SERVER['REMOTE_ADDR'];
// these are the IP's that are allowed to view the site:
$allowed = array('111.111.111.111', '222.222.222.222');
if (file_exists($maintenanceFile) && !in_array($ip, $allowed)) {
include_once dirname(__FILE__) . '/errors/503.php';
exit;
}
以下将与一个apache安装(需要检查与他人)工作。
您可以根据维护的HTML页面的发言权index.html
创建自己的自定义网站并将其放置在您的安装根目录。
打开.htaccess
文件夹,并从index.php
重命名默认页面index.html
。重启Apache。一旦你完成重命名默认页面返回给index.php
。
它应该工作。
这些都是很好的模块,把你的Magento网站成你想要maintaince模式随时随地。 http://www.magentocommerce.com/magento-connect/store-maintenance.html
OR
如果你想在代码的工作,然后创造出把你的网站进入maintaince模式maintaince.flag
文件的乐趣。如果你想改变它的模板,则跳转至
errors/default/503.phtml
文件。只要改变它的设计。
这是一个简单的解决方案。
您可以检查此文章,它具有约puting店维修了几个IP地址,并有一定的工作实例信息和所需要的文件:
我跟着 本教程 要将我的 Magento 商店置于维护模式,您可以尝试如下操作:
在您的magento 根目录中创建一个文件名maintenance.flag。该文件下的内容无关紧要,可以将其保留为空。
更改维护文件(位于 magento 根 -> 错误 -> 默认目录)以在用户访问您的网站时显示正确的消息。希望这有帮助
检查出这个 http://www.magentocommerce.com /magento-connect/all4coding-offline-maintenance-page.html 该提供你正在寻找什么。用的magento 1.4兼容 - 。1.8
您也可以用你的设计主题,显示维护页面。
的Magento具有的 maintenance.flag 强>支持内置的。检查了这一点从
我按照这个教程 http://magentoexplorer.com/how-to-show-and-customize-magento-maintenance-mode-page 要在 Magento 中启用维护模式页面,您需要创建maintenance.flag 文件并将其上传到 Magento 根文件夹,但是要获得良好的维护模式还需要一些其他步骤。
添加维护期间例外(维护期间允许特定IP访问您的站点)。在index.php中,添加这些行
$ip = $_SERVER['REMOTE_ADDR'];$allowed = array('x.x.x.x','y.y.y.y');
- 编辑维护模式页面编辑维护模式页面 /错误/默认/503.phtml去掉包裹 /errors/default/page.phtml
希望这可以帮助。
如果您需要将 Magento 置于维护模式 仅有的 在前端,启用管理员身份验证,您可以尝试以下步骤:
- 打开index.php(从Magento根安装)
搜索以下内容(第 63 行左右):
if (file_exists($maintenanceFile)) {
替换为:
if (file_exists($maintenanceFile) && !preg_match('/^\/(admin|index.php\/admin)/', $_SERVER['REQUEST_URI'])) {
创建一个名为的空白文件 维护标志 在您的 Magento 根安装中:
$ touch maintenance.flag
该解决方案的灵感来自 Opencart 中使用的维护模式,该模式使用相同的行为。
创建在你的Magento存储根空maintenance.flag文件。