How to add 301 redirections for the base URL in Magento 2.1 via .htaccess.
I want to all these url versions 301 redirected to https://www.example.com
.htaccessmagento-2.1.8
How to add 301 redirections for the base URL in Magento 2.1 via .htaccess.
I want to all these url versions 301 redirected to https://www.example.com
Best Answer
Here it is step by step answer for it.
Or if you want this via .htaccess then please check below.
Rather than redirecting an entire domain, this 301 Redirect – simply named “Redirect 301” is a single-line, single-page redirect.
For example:
This would redirect the URL:
To:
If you wish to 301 redirect to another domain name you can simply add the domain to the destination URL:
Note: The 301 part of the above code can be changed to represent any http status code you wish to use e.g. 301, 503 etc.
Hope it will help you.
Thanks