How to add 301 redirections for the base URL in Magento 2 via .htaccess.
I want to redirect to these url versions 301 to http://www.example.com
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It only takes a minute to sign up.
Sign up to join this communityHow to add 301 redirections for the base URL in Magento 2 via .htaccess.
I want to redirect to these url versions 301 to http://www.example.com
Try This :-
<IfModule mod_rewrite.c>
############################################
## enable rewrites
Options +FollowSymLinks
RewriteEngine on
redirect 301 /old_url new_url with full path
......
You can set multiple redirects Like this
Try this to redirect all URLs to 301
Options +FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]