I have changed my website's domain. For eg. www.abc.com to www.xyz.com.
Now I want to set 301 redirect for www.abc.com to www.xyz.com.
I have checked Catalog > URL Rewrite Management.
Is that right way to do it? Or how can I do that redirect for the main URL from Magento backend.
2 Answers
You can do this through your .htaccess file. Unfortunately, Magento does not have a built in functionality for redirecting root domains.
Add this to your .htaccess file. It will 301 redirect all requests from the old domain to the new one.
RewriteEngine on
RewriteCond %{HTTP_HOST} ^old.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.old.com [NC]
RewriteRule ^(.*)$ http://www.new.com/$1 [L,R=301,NC]
-
How can i redirect my abc.com to www.abc.com by using 301 redirect– zusCommented Feb 8, 2018 at 11:07
Best way will be you can do it is if you can access database.
UPDATE core_config_data SET value = "www.xyz.com/" WHERE value = "www.abc.com/"
Then delete your cache and session folder inside magento_root_folder/var
OR
If you can access your backend from your old URL then change Base URL in:
System > Configuration > General > Web > Unsecure
System > Configuration > General > Web > Secure
And clear your cache and session after it.