Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirection in magento

I am working on custom module. I try to redirect my module to magento catalog category page. The link for the page is

http://localhost/project/index.php/admin/catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/

I have tried following methods without success.

$this->_redirect($this->getUrl("admin/catalog_category/")); $this->_redirect("admin/catalog_category/");

Magento is removing admin from url ? final url look like that

http://localhost/project/index.php//catalog_category/index/key/cc65595b0383ca64fb245cb7de2359d8/

I didn't figure out why admin is skipping from my url ? can anyone help ?

like image 317
Mahmood Rehman Avatar asked Oct 21 '22 13:10

Mahmood Rehman


1 Answers

Try below code.

$this->_redirect("adminhtml/catalog_category");

The first URI(ie adminhtml) is module name and for admin area the module name is adminhtml.

like image 129
Anant Avatar answered Oct 25 '22 17:10

Anant