I have one category in magento shop called shop online. I want to redirect this category and its sub category to the home page using the htaceess. Tried this in htaccess to redirect
RedirectMatch 301 ^/shop-online/$ http://www.domainname.com/index.php
can anyone please help me...
Best How To :
In Magento, it's wrong to do redirects in .htaccess, but most newbies still solve the issue this way.... Your problem is that category urls in Magento usually have .html extension, so try this:
RedirectMatch 301 ^/shop-online.html$ http://www.domainname.com/index.php
The correct way is to create a url rewrite. In the admin, go to Catalog -> Url Rewrite Management. Create a custom URL Rewrite for your Shop Online category. If there's already a url rewrite for your category (there will be one when the category is first created), delete it.
Basically how url rewrites work is that Magento looks at the url and matches it to the Request Path in the above screenshot. If it matches, it sends a location header to the Target Path.