I'm creating a new magento module. The frontend name of the module is groupedproduct. Now i need to map a dynamic url to indexAction of the IndexController. For example the url will of the form http://localhost/magento/groupedproducts/subcat1 This url will be dynamic for example http://localhost/magento/groupedproducts/subcat2, http://localhost/magento/groupedproducts/subcat3 I want to redirect all this url to http://localhost/magento/groupedproducts/index/index.

I tried using .htaccess file and added following redirect rule

Options +FollowSymLinks
RewriteEngine on
RewriteBase /magento/
RewriteRule ^groupedproducts/(.*)$ index.php/groupedproducts/index [NC]

But it not working. I have checked and confirmed that the .htaccess and mod_rewrite are working by adding simple rewrite rule to a php file.

  • How you generating dynamic value subcat1 ,subcat2 etc. Seems based on the value subcat1 you need to change the action name? – Akhil Gupta Jul 13 '16 at 8:55

Try this

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^subcat([0-9a-zA-Z]+) http://localhost/magento/groupedproducts/index/index [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.