Skip to content

Magento 2 – can’t access admin (backend) after setting up custom Admin URL

I changed the custom admin URL via the admin.

I’ve set Stores -> Settings: Configuration -> Advanced: Admin -> Admin Base URL -> Use Custom Admin URL to Yes

I’ve set Stores -> Settings: Configuration -> Advanced: Admin -> Custom Admin URL -> Custom Admin URL to adminxyz

but just after saving it showed me the 404 site.

enter image description here

Now I can’t access the admin (backend) anymore:

So I opened phpMyAdmin and noticed that in the table core_config_data the entries with path web/unsecure/base_url and web/secure/base_url changed to adminxyz.

So I changed them back to my domain https://www.example.com/

I also set the of path admin/url/use_custom from 1 to 0.

But I still can’t login in the backend.

I already flushed the cache and reindexed.

If I execute php bin/magento info:adminuri then I get:

Admin URI: /adminxyz

I even made this entry in my app/etc/env.php:

<?php
return [
    'backend' => [
        'frontName' => 'adminxyz'
    ],