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
http://localhost:8080/wp-admineverything looks fine. But the links point tooptions-general.php,edit.php,plugins.phpand so on which results inhttp://localhost:8080/options-general.php,http://localhost:8080/edit.php,http://localhost:8080/plugins.phpand so on.Only on
http://localhost:8080/wp-admin/index.phpandhttp://localhost:8080/wp-admin/the links result inhttp://localhost:8080/wp-admin/options-general.phpand 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_headerfunction (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.ww.wp.xz.cn?
What is the best solution?
The topic ‘missing base href in wp-admin (needed for PHP built-in webserver)’ is closed to new replies.