Whenever Add Secret Key to URLs feature is enabled in admin, admin grid is redirecting to dashboard.

When it is disabled it is redirecting to correct URL(same page).

Please suggest how to pass secret key to URL.

return $resultRedirect->setUrl('*/*/index');

  • I dont understand what is your question but if you asking for "secret_key" to pass in url then you don't need to pass secret key from url it will automatically taken by magento's default way. – Himanshu Sep 28 '18 at 4:59

You form must have form key to allow submit data. Like this : Click here

Then you can redirect to dashboard using this below line :


you can try setPath('frontname/controller/action')


You can give controller and action name in redirection

return $resultRedirect->setUrl('route/contoller/index');

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.