Redirects is a widely used approach not only in Magento but in most of other web applications. Saying “redirect” we usually mean a rule or a set of rules for sending user from one URL to another. Using Magento 1 you can easily handle redirects by writing just one line of the code, but in Magento 2, because of its new architecture based on Dependency injection, the process of building a redirect is a bit more complex. Let’s review a new redirect creation by building a simple extension that redirects user from a category page to a product view page if there’s only one product in this category.
Every owner of the web store does all possible to provide good conditions for customers and takes care of their needs. Moreover, it is also good practice to use different services to track the behaviours of web store visitors, collect and analyze the data related to customers preferences to determine how to improve the conversion rate. As a one way of such improvements is to test if there are any issues on the web store. Maybe you’ve heard the words “to win the battle – at least, you should know your enemy”, as follows – you should find what problems the website has. In our article we are describing possible ways to notify the store owner or website admin about 404 pages. Therefore, if you know what URLs are sending the customers to 404 pages, you will be able to fix it by creating the corresponding redirects, rewriting rules etc.