Skip to content

Multisite does not work when Full Page Cache is enabled (FPC ignores MAGE_RUN_CODE) #1510

@dmitrii-fediuk

Description

@dmitrii-fediuk

I have 2 VirtualHosts:

Listen 1800
<VirtualHost 127.0.0.1:1800>
    ServerName localhost.com
    DocumentRoot "C:/work/m2"
    SetEnv MAGE_MODE "developer"
    SetEnv MAGE_RUN_TYPE "website"
    SetEnv MAGE_RUN_CODE "discourse_pro"
    RemoteIPHeader X-Forwarded-For
</VirtualHost>
Listen 1900
<VirtualHost 127.0.0.1:1900>
    ServerName localhost.com
    DocumentRoot "C:/work/m2"
    SetEnv MAGE_MODE "developer"
    SetEnv MAGE_RUN_TYPE "website"
    SetEnv MAGE_RUN_CODE "mage2_pro"
    RemoteIPHeader X-Forwarded-For
</VirtualHost>

It is works when FPC is disabled, but does not work if FPC is enabled.
When FPC is enabled, Magento 2 caches the website on the first request, and then shows it for the both website requests, totally ignoring what the site is actually requested.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions