Open Chouby opened 1 month ago
Hi, @Chouby
The Site Title block uses the home_url
function as the link. This could be an issue with the WP subfolder installation itself, or there's a filter that modifies the home_url
behavior.
What result do you get if you run echo home_url()
?
Hi @Mamaduka,
You went too fast for me ;). I was preparing the PR to add the slash in home_url()
.
When I run echo home_url()
, I get https://mysite.com/wordpress
.
When I run echo home_url( '/' )
, I get https://mysite.com/wordpress/
.
Thank you, @Chouby!
I checked similar usages in WP core, like "Visit Site" in the admin bar, and it's using a trailing slash, which seems like the correct solution.
Here's the old core ticket for a similar issue: https://core.trac.wordpress.org/ticket/19314.
Also, I think we should update the Home Link block. Would you mind including it in your PR?
cc @SergeyBiryukov
Done for the home Link block too.
Description
When WordPress is installed in a subfolder, the home url is let say
https://mysite.com/wordpress/
with a trailing slash. However the site title block links tohttps://mysite.com/wordpress
without trailing slash which is then redirected to the canonical urlhttps://mysite.com/wordpress/
.The same kind of issue occurs for multisite where sites are installed in folders.
Step-by-step reproduction instructions
https://mysite.com/wordpress
https://mysite.com/wordpress
tohttps://mysite.com/wordpress/
Screenshots, screen recording, code snippet
No response
Environment info
WP 6.6 + Twenty Twenty Four
Please confirm that you have searched existing issues in the repo.
Please confirm that you have tested with all plugins deactivated except Gutenberg.