Change admin url

default discord avatar
generator101
8 months ago
5

Is it possible to change the admin url?


Default right now is

/admin

, what if I want to change it to

/login

or

/custom-admin-login

?

  • default discord avatar
    bombnp
    8 months ago

    check the

    routes

    key in payload config.

    https://payloadcms.com/docs/configuration/overview
    image.png
  • default discord avatar
    generator101
    8 months ago

    great, thanks, I missed that in the doc



    routes: {
       admin: '/custom-admin-login',
    },


    here is what I added in

    payload.config.ts

    in case someone else comes across this question

  • default discord avatar
    arskeliss
    8 months ago

    Thanks mate, this helps me as well. Cheers

  • default discord avatar
    gregwhitworth
    2 months ago

    @generator101 this is all well and good to create a new landing page; but I'm fine with the current login but want to change /admin once logged in to be

    settings

    . So when you changed yours to

    /custom-admin-login

    what does navigation upon login look like? Take the following example:



    http://localhost:3000/admin/collections/media?limit=10

    With your change does it then look like this:



    http://localhost:3000/custom-admin-login/collections/media?limit=10

    cc: @bombnp just in case you know

  • default discord avatar
    bombnp
    2 months ago

    yes. If you change admin route to /custom-admin-login, then any url that would originally be /admin/* becomes /custom-admin-login/*

Open the post
Continue the discussion in Discord
Like what we're doing?
Star us on GitHub!

Star

Connect with the Payload Community on Discord

Discord

online

Can't find what you're looking for?

Get help straight from the Payload team with an Enterprise License.