Video Lesson: Create a new custom route in Magento

Create a new custom route in Magento

This is premium content

Only available to enrolled or University students.
Join today to unlock all lessons in this course.

Create a new custom route in Magento

Learn how to define a custom Magento 2 frontend route in routes.xml for a blog module.

Lesson Content

When a web request comes in to Magento, the standard router looks through all of the defined routes from the combined routes XML files. If it finds a match, then the module defined in that route is responsible for handling the request.

Since we haven’t yet set up a route, let’s do that now. Within the etc directory, create a frontend directory. This tells Magento that this is a frontend route, and inside it we’ll create a file named routes.xml.

This file will have a standard config node, with the noNamespaceSchemaLocation set to Magento Framework’s routes.xsd file.

Premium content

Enroll to unlock the full content and all course materials.

Maggie

Hey, I'm Maggie! 👋

Ask me anything.

Want to chat with Maggie?

Enroll in this course for AI tutor access.

Comments

Join the discussion!

Comments

Want to comment on this lesson?

Enroll in this course to leave comments.