0

How to add 301 redirections for the base URL in Magento 2 via .htaccess.

http://www.example.com//?

I want to redirect to these url versions 301 to http://www.example.com

0

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

| improve this answer | |
0

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]
  

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.