File tree Expand file tree Collapse file tree 5 files changed +36
-26
lines changed
Expand file tree Collapse file tree 5 files changed +36
-26
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,5 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
66
77## [ Unreleased]
88### Added
9- ### Changed
10- ### Removed
11- ### Fixed
9+
10+ - Cronjob that generates rewrite map files for each store and redirect type
Original file line number Diff line number Diff line change 1313
1414---
1515
16- Generate RewriteMap files for Apache from Magento URL rewrites
16+ Generate RewriteMap files for Apache from custom Magento URL rewrites (redirects). This can be useful to re-use the rewrites in a different frontend.
17+
18+ For example, to use the redirects in ** Vue Storefront** , a reverse proxy that uses the generated rewrite maps can be configured.
1719
1820## Installation
1921
@@ -29,8 +31,17 @@ Generate RewriteMap files for Apache from Magento URL rewrites
2931
3032## Configuration
3133
34+ In your store configuration navigate to *Catalog > SEO*:
35+
36+ - **Enable Rewrite Maps Generation**: set to "yes" to enable (Default: no)
37+ - **Rewrite Maps Generation Cron Schedule**: configure, when rewrite maps are regenerated (Default: every hour)
38+
3239## Usage
3340
41+ Rewrite maps are stored in `var/rewrite_maps` as one text file per store and redirect type (301, 302).
42+
43+ See http://httpd.apache.org/docs/current/rewrite/rewritemap.html for details how to use those files.
44+
3445## Changelog
3546
3647Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.
Original file line number Diff line number Diff line change 33
44namespace IntegerNet \RewriteMap \Cron ;
55
6- use IntegerNet \RewriteMap \Model \RewriteMapsSavingService as RewriteMapsSavingService ;
6+ use IntegerNet \RewriteMap \Model \RewriteMapsSavingService ;
77use Magento \Framework \App \Config \ScopeConfigInterface ;
8- use Magento \Framework \Exception \FileSystemException as FileSystemException ;
8+ use Magento \Framework \Exception \FileSystemException ;
99use Magento \Framework \Exception \InputException ;
10- use Psr \Log \LoggerInterface as LoggerInterface ;
10+ use Psr \Log \LoggerInterface ;
1111
1212class GenerateRewriteMaps
1313{
Original file line number Diff line number Diff line change 11<?xml version =" 1.0" ?>
2- <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Config:etc/system_file.xsd" >
3- <system >
4- <section id =" catalog" >
5- <group id =" seo" >
6- <field id =" rewrite_maps_generation_enabled" showInDefault =" 1" showInStore =" 1" showInWebsite =" 1"
7- sortOrder =" 500" translate =" label" type =" select" >
8- <label >Enable Rewrite Maps Generation</label >
9- <comment >
10- <![CDATA[ Enables the generation of rewrite maps files from the Magento UrlRewrites.
2+ <config xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance"
3+ xsi : noNamespaceSchemaLocation =" urn:magento:module:Magento_Config:etc/system_file.xsd" >
4+ <system >
5+ <section id =" catalog" >
6+ <group id =" seo" >
7+ <field id =" rewrite_maps_generation_enabled" showInDefault =" 1" sortOrder =" 500" translate =" label"
8+ type =" select" >
9+ <label >Enable Rewrite Maps Generation</label >
10+ <comment >
11+ <![CDATA[ Enables the generation of rewrite maps files from the Magento UrlRewrites.
1112 The files are saved under
1213 path_to_magento/var/rewrite_map/map/rewrite-map-[REDIRECT_TYPE]-store-[STORE_ID].txt]]>
13- </comment >
14+ </comment >
1415 <source_model >Magento\Config\Model\Config\Source\Yesno</source_model >
15- </field >
16- <field id =" rewrite_maps_generation_cron_schedule" showInDefault =" 1" showInStore = " 1 " showInWebsite = " 1 "
17- sortOrder = " 510 " translate = " label " type =" text" >
18- <label >Rewrite Maps Generation Cron Schedule</label >
19- </field >
20- </group >
21- </section >
22- </system >
16+ </field >
17+ <field id =" rewrite_maps_generation_cron_schedule" showInDefault =" 1" sortOrder = " 510 " translate = " label "
18+ type =" text" >
19+ <label >Rewrite Maps Generation Cron Schedule</label >
20+ </field >
21+ </group >
22+ </section >
23+ </system >
2324</config >
Original file line number Diff line number Diff line change 66use IntegerNet \RewriteMap \Model \RewriteMapRepository ;
77use Magento \Store \Api \StoreRepositoryInterface ;
88use Magento \TestFramework \Helper \Bootstrap ;
9- use Magento \UrlRewrite \Model \OptionProvider ;
109use PHPUnit \Framework \TestCase ;
1110
1211/**
You can’t perform that action at this time.
0 commit comments