Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure to set the canonical URL only if the URI string is not empty to avoid /0 as the href value in the profile view #9837

Merged
merged 1 commit into from
Mar 5, 2025

Conversation

Kubik-Rubik
Copy link
Contributor

Summary of Changes

This PR will fix the following error in the profile view:

<link href="/0" rel="canonical">

For instance, you can open rich's profile page (https://www.kunena.org/forum/user/2198-rich) and check the source code. You will find the wrongly created canonical URL in the header section. This 404 link is made on each profile page and affects SEO.

Testing Instructions

Check any profile page in the latest release. Apply the patch, and the incorrect tag will no longer be created.

…y to avoid `/0` as the href value in the profile view
@xillibit xillibit added this to the 6.3 milestone Mar 3, 2025
@xillibit
Copy link
Member

xillibit commented Mar 3, 2025

I don't see in which situation there is a wrong url to the user profile, i have opened the user profile as not logged and logged but the links to the profile in the header are correct

@xillibit xillibit merged commit ce24b4d into Kunena:K6.3 Mar 5, 2025
4 checks passed
@Kubik-Rubik Kubik-Rubik deleted the vvogel-canonical-rel-0 branch March 6, 2025 20:07
@Kubik-Rubik
Copy link
Contributor Author

@xillibit, thanks for the merge!

To your previous posting: If you check the profile page's source code, you will see the broken canonical URL that was fixed with this PR. Screenshot:

grafik

xillibit pushed a commit that referenced this pull request Mar 9, 2025
…ot empty to avoid `/0` as the href value in the profile view (#9837)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants