Reroute requests to a CMS backend

The following procedure describes how to reroute incoming requests from a Magento Commerce store to a separate WordPress site using the Fastly edge module Other CMS/backend integration with an Edge dictionary. You can follow a similar process to reroute requests to other CMS backends.

Edge modules help you create and upload custom VCL code from the Magento Admin UI instead of manually writing the VCL code and uploading it using the Fastly API.

We recommend adding custom VCL configurations to a Staging environment where you can test them before updating the Fastly service configuration in the Production environment.

Prerequisites

  • Ensure that you are running the latest version of the Fastly CDN module for Magento 2. See Upgrade the Fastly Module.

  • Verify the environment configuration for the Fastly service. See Check Fastly caching.

  • You must have Admin credentials to access the Magento Cloud Staging and Production environments.

To reroute requests from Magento Commerce to WordPress:

  1. Enable Fastly Edge Modules in the Staging or Production environment.

    • Log in to the Magento Admin.

    • Navigate to Stores > Configuration > Advanced > System > Full Page Cache > Fastly Configuration > Advanced.

    • Set the value for Fastly Edge Modules to Yes.

    • Save the configuration.

  2. Identify the URL paths to reroute to the WordPress backend.

  3. Complete the following tasks to configure the Fastly service and create the custom VCL code to reroute the requests to the WordPress backend.

    • Create an Edge Dictionary that specifies the paths to reroute from the Magento Commerce store to the backend.

    • Add the WordPress backend to the Fastly service configuration and attach the request condition for the URL rewrites.

    • Configure the Other CMS/backend integration Edge Module to handle the URL rewrites from Magento Commerce to the WordPress backend.

    For detailed instructions, see Fastly Edge Modules - Other CMS/Backend integration in the Fastly CDN module for Magento 2 documentation.

  4. After updating the Fastly service configuration, test your store to ensure that the specified URL requests for WordPress are rerouted correctly.