How would I create 301 redirects from my old domain URLs to my new M2 site URLs?
2 Answers
There are a few ways:
- In the .htaccess or VirtualHost configuration of Apache or nginx
- A Router observer in Magento that maps a regex of particular patterns to rewrite to the new Magento location from your legacy application's URL
- Create records in the
core_url_rewrite
table
This function is built into Magento2 already, guide below:
https://docs.nexcess.net/article/how-to-write-redirect-301-rules-for-magento-2.html