是否可以将 magento 站点置于维护标志下,以便访问者收到该站点正在建设中的消息?我在管理区域中找不到此设置。
另一个解决方案也将受到欢迎。
任何帮助,将不胜感激。
谢谢你。
是否可以将 magento 站点置于维护标志下,以便访问者收到该站点正在建设中的消息?我在管理区域中找不到此设置。
另一个解决方案也将受到欢迎。
任何帮助,将不胜感激。
谢谢你。
要在 Magento 中启用维护模式,只需在 Magento 存储的根目录中创建空的maintenance.flag文件。
我经常用这个。http://incho.net/ecommerce/magento/maintenance-mode-in-magento/
重要的部分是:
打开:在根目录及以上第 57 行添加的 index.php(记得编辑“允许”数组以包含您希望能够访问该站点的 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)) {
Just add a blank file called maintenance.flag to your root.. job done
A neater solution is to use this extension.
it allow you to set the store up so that once logged into the back end you have access to the front + a few other neat features
这就是我添加到索引中的内容,以便能够继续从不同的 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;
}
您可以查看这篇文章,它包含有关将存储放入多个 IP 的维护的信息,并有一些工作示例和所需文件:
以下内容适用于 apache 安装(需要与其他人核实)。
您可以在维护 html 页面下创建自己的自定义站点index.html
,并将其放在安装的根目录中。
打开.htaccess
文件夹并将默认页面从 重命名index.php
为index.html
。重启阿帕奇。完成后将默认页面重命名为index.php
.
它应该工作。
这些是很好的模块,可以随时将您的 magento 站点置于维护模式。 http://www.magentocommerce.com/magento-connect/store-maintenance.html
或者
如果您想在代码上获得乐趣,请创建maintenance.flag
将您的站点置于维护模式的文件。如果你想改变它的模板然后转到
errors/default/503.phtml
文件。只是改变它的设计。
这是一个简单的解决方案。
看看这个http://www.magentocommerce.com/magento-connect/all4coding-offline-maintenance-page.html它提供了你正在寻找的东西。与 magento 1.4 - 1.8 兼容。
您还可以使用您的设计主题显示维护页面。
Magento内置了maintenance.flag支持。从这里查看
http://www.nicksays.co.uk/2010/07/enabling-magento-maintenance-mode/
我按照本教程将我的 Magento 商店置于维护模式,您可以尝试如下:
在您的 magento 根目录中创建一个文件名 maintenance.flag。这个文件下的内容无所谓,你可以留空。
更改维护文件(位于 magento 根目录 -> 错误 -> 默认目录)以在用户访问您的网站时显示正确的消息。跳这有帮助
我按照本教程http://magentoexplorer.com/how-to-show-and-customize-magento-maintenance-mode-page在 Magento 中启用维护模式页面,您需要创建维护.flag 文件并将其上传到 Magento 根目录文件夹,但是对于良好的维护模式还有更多步骤,例如。
在维护期间添加例外(在维护期间允许特定 IP 访问您的站点)。在 index.php 中,添加这些行
$ip = $_SERVER['REMOTE_ADDR']; $allowed = array('xxxx','yyyy');
希望这可以帮助。
如果您只需要在前端将 Magento 置于维护模式,让管理员启用身份验证,您可以尝试以下步骤:
搜索以下内容(第 63 行左右):
if (file_exists($maintenanceFile)) {
替换为:
if (file_exists($maintenanceFile) && !preg_match('/^\/(admin|index.php\/admin)/', $_SERVER['REQUEST_URI'])) {
在 Magento 根安装中创建一个名为maintenance.flag的空白文件:
$ touch maintenance.flag
该解决方案的灵感来自 Opencart 中使用相同行为的维护模式。
在 Magento 商店的根目录中创建一个空的 maintenance.flag 文件。