1

How to remove /home after baseUrl ?

www.baseurl.com/home

I want to redirect www.baseurl.com/home to www.baseurl.com (301)

6

You can do it using htaccess file . In htacess file find:

Options +FollowSymLinks RewriteEngine on

Then Put the below code in htaccess file

RewriteCond %{THE_REQUEST} ^.*/home RewriteRule ^(.*)home$ http://www.domain.com/$1 [R=301,L]

or you can do this by

Go to System->Configuration->Web->Url Options and set the field Auto-redirect to Base URL to No.

Please check following links for more reference Product Page without www redirect to home instead of itself

https://stackoverflow.com/questions/23129310/magento-redirect-the-url-from-www-domain-com-home-to-base-url-www-domain-com

  • 1
    This solution will work perfectly, but when we programmatically get the base url it will not work. – Ashish Viradiya Nov 27 '18 at 8:33
2

First update both the web/unsecure/base_url and web/secure/base_url URLs in core_config_data table to http://www.baseurl.com/ in your database.

Then clear the cache and remove generated/ folder

Ensure you have updated your virtual host settings according to the new URL.

Once you set the applied the virtual host changes, restart the apache server

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.