missing base href in wp-admin (needed for PHP built-in webserver)
-
I’m currently testing WordPress with a custom setup using the built-in PHP webserver (
php -S localhost:8080 -t .
) and I stumbled upon a problem.When I access
https://localhost:8080/wp-admin
everything looks fine. But the links point tooptions-general.php
,edit.php
,plugins.php
and so on which results inhttps://localhost:8080/options-general.php
,https://localhost:8080/edit.php
,https://localhost:8080/plugins.php
and so on.Only on
https://localhost:8080/wp-admin/index.php
andhttps://localhost:8080/wp-admin/
the links result inhttps://localhost:8080/wp-admin/options-general.php
and so on.I am aware that the PHP built-in webserver should normally not be used but I have to use it since there are several issues with the WP CLI like https://github.com/wp-cli/server-command/issues/71 and I just need a small local demo setup using https://github.com/DanielRuf/run-local-wordpress.
I added the missing base metatag in the
wp_admin_bar_header
function (not sure if this is the best or correct place; I know that there is probably ais_admin()
check missing) using a simpleecho "<base href=\"".admin_url('')."\">";
.I suggest to add an option to enable the output of correct base href metatags. Is this something that should be reported at https://core.trac.www.remarpro.com?
What is the best solution?
- The topic ‘missing base href in wp-admin (needed for PHP built-in webserver)’ is closed to new replies.