Devdocs: Update maintenance page for multistore setup

Created on 3 Dec 2018  路  4Comments  路  Source: magento/devdocs

Topic clarification/correction request

Topic Link

Description

Guide/suggestion for multistore maintenance pages.

A problem i faced was to have different layout and localized content. As speculated here (same for Magento2) it not possible out of the box, but it is.

The error processor accepts an parameter to change the error page template.

        if (isset($_GET['skin'])) {
            $this->_setSkin($_GET['skin']);
        }

This can be passed via rewrite rule in .htaccess and needs no further changes. IMHO this should be documentated for multistore setups.

Possible solutions

Add documentation for $_GET['skin'] parameter

  • check if .maintenance.flag exists
  • check host (or whatever you want - ENV variables maybe)
  • set parameter

.htaccess:

RewriteCond %{DOCUMENT_ROOT}/var/.maintenance.flag -f
RewriteCond %{HTTP_HOST} ^sub.example.com$
RewriteCond %{QUERY_STRING} !(^|&)skin=sub(&|$) [NC]
RewriteRule ^ %{REQUEST_URI}?skin=sub [L]

copy files:

  • pub/errors/default/503.phtml to pub/errors/sub/503.phtml
  • pub/errors/default/css/styles.css to pub/errors/sub/css/styles.css
  • make your edits there

(directory name has to match url parameter)

Additional information

nginx setting should be added too.

Help Wanted done Technical

All 4 comments

We are re-organizing our unresolved GH issues into smaller, more focused projects, and have moved this to the the Installation and Configuration Documentation project.

Hi @meker12 How can I assign this issue to me?

@Ketika, only someone with write access to this repo can assign issues. I've assigned this to you.

@magento I am working on this

Was this page helpful?
0 / 5 - 0 ratings