How to get Default No Route URL Programmatically Magento 2?

Get No Route Url Programmatically Magento 2 to redirect to 404 Not found page.

You can redirect to No Route page using ScopeConfigInterface and UrlInterface to not found action. The default value for the No Route page is the cms/noroute/index. Continue reading “How to get Default No Route URL Programmatically Magento 2?”

How to get Forgot Password Url in Magento 2?

You can retrieve the forgot password URL from the Customer Module of Magento.

The customer module contains the Forgot password feature for the Account Section. If you have created an account with Magento and you forgot the password and want to reset the password, You can get forgot password page URL by just instantiate the Url Class of Customer Module. Continue reading “How to get Forgot Password Url in Magento 2?”

Get Backend Base Url in JS file Magento 2?

You can get base URL of the backend/admin panel in javascript(JS) file to fetch Custom URL of a site to call ajax request in backend area.

‘mage/url’ widget is not used to fetch backend base URL in Magento 2.

You need to create a template file using layout XML and define the base URL of backend under the template file. Continue reading “Get Backend Base Url in JS file Magento 2?”