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.
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!