Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Ron Rennick

    (@wpmuguru)

    There is a checkbox in the domain mapping settings for running the dashboard under the original domain. Uncheck that box.

    Thread Starter Marcel Bootsman ????

    (@mbootsman)

    Ron, thanks for your reply.

    I don’t agree that is the solution. Let me explain why.

    In the network Domain Mapping options I have the “Redirect administration pages to site’s original domain (remote login disabled if this redirect is disabled)” option disabled.

    In the site’s Domain Mapping settings, the primary domain is set as “domainx.com”, “domainx.domain.com” is listed unter the primary domain.

    According to my logic, if we use the admin_url() function with these settings, this should return the admin url according to the setting of the primary domain in the site’s Domain Mapping settings, currently being “domainx.com”.

    If I would enable the “Redirect administration …” option, I would expect admin_url() to return “domainx.domain.com”.

    Can you please follow up? Thanks!

    Plugin Author Ron Rennick

    (@wpmuguru)

    Are you referring to links on the front end of the site or in the dashboard?

    Thread Starter Marcel Bootsman ????

    (@mbootsman)

    Ron,

    I believe it’s only in the dashboard, haven’t tested it on frontend. There’s a plugin that uses admin_url() to get the current admin url for authentication purposes. If this gets the wrong url, authentication is not possible.

    Plugin Author Ron Rennick

    (@wpmuguru)

    Just for clarification – you are in the dashboard at https://domainx.com/wp-admin/ and are getting admin_urls https://domainx.domain.com/wp-admin/ ?

    Thread Starter Marcel Bootsman ????

    (@mbootsman)

    Ron,

    exactly!

    Plugin Author Ron Rennick

    (@wpmuguru)

    When you click on them what happens?

    Thread Starter Marcel Bootsman ????

    (@mbootsman)

    Ron,

    when the url domainx.domain.com, this get rewritten dto domainx.com. But, since the authentication uses the non-rewritten url, the authentication fails. BTW it concerns a Facebook app authentication.

    Plugin Author Ron Rennick

    (@wpmuguru)

    You can write a small plugin & use the admin_url filter to change it – https://wpseek.com/hook/admin_url/

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘admin_url() gives wrong domain name’ is closed to new replies.