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

Different canonical URLs for same content #6891

Open
felixhahnweilheim opened this issue Mar 18, 2024 · 2 comments
Open

Different canonical URLs for same content #6891

felixhahnweilheim opened this issue Mar 18, 2024 · 2 comments

Comments

@felixhahnweilheim
Copy link
Contributor

The problem

https://community.humhub.com/s/general-discussion/ and https://community.humhub.com/s/general-discussion/home are the exact same page. However, both are set as canonical URL in the HTML source.

Same for https://community.humhub.com/u/luke and https://community.humhub.com/u/luke/home

(Those are just examples, it happens with all spaces and users with default settings.)

What is the expected result?

The same canonical URL is used for both pages.

My suggestion

Set the link with '/home' as canonical.
Some spaces have a custom start page, so the direct link without '/home' redirects to another page. The '.../home' URL always works.

Additional info

Q A
HumHub version 1.?
PHP version
Operating system

Note: Also provide the full error stacks from Administration --> Information --> Logging and errors from your browser console if possible.
Note: Please use the community site for any questions on customizing HumHub.

@ArchBlood
Copy link
Contributor

I believe this is mostly due to the use of createUrl() being used within both the user profile & space.

An easy workaround would be a Url helper that would handle such issues.

User Example

'url' => $user->createUrl('/user/profile/home'),

@luke-
Copy link
Contributor

luke- commented Mar 18, 2024

It would be good to always have a canonical/single URL for such pages.

We have to take into account that /u/luke does not always point to /u/luke/home, because the start page of Profiles & Spaces is changeable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants