Magento 2 – Admin URL always only 404 “Page not found”

As a continuation of the previous article, here is a note on another problem, which existed after we copied a live shop to another server and wanted to make it available there as a test shop: Every time we use the backend / wanted to reach the admin area, we got the info “404 – Page not found”.

It should be said about this, that in this installation we use a different URL for the backend than the frontend.

As part of the adaptation of the live shop for test operation, we had in the database (Tabelle core_config_data) after all entries with the path “base_url” search:

SELECT * FROM `core_config_data` WHERE `path` LIKE '%base_url%' 

All assigned URLs must then be adapted to the specific URLs of the test environment, so that the test shop can be reached.

Each URL has been color coded. So here we have three different URLs in use

But what now? (Difference to Magento 1) is not listed here, is the special URL, when you're in Magento 2 deposited backend, that you want to use a different URL for the backend (Stores > Configuration > Advanced > Admin > Admin Base URL). This must be adjusted separately. The path isn't here “%base_url%” but “admin/url/custom”. The special URL for the backend is then entered here:

If you then clear the cache, you can reach the backend again. If necessary. nor clear the browser cache and/or use the private mode of the browser!

Published by Covos

Since 2009 I have been working intensively with Magento. I started with the creation and operation of B2C stores. This was extended through my work in the logistics sector. This resulted first specialized B2E systems. Today I work day-a day with exciting B2C, B2B- and B2E projects and reports in this blog about challenges and give insider tips.

Leave a Reply

Your email address will not be published. Required fields are marked *