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

[Feature]: Refactor normalizeHref for Optimal SEO URL Handling #1916

Open
coratgerl opened this issue Mar 6, 2025 · 1 comment
Open

[Feature]: Refactor normalizeHref for Optimal SEO URL Handling #1916

coratgerl opened this issue Mar 6, 2025 · 1 comment

Comments

@coratgerl
Copy link
Contributor

coratgerl commented Mar 6, 2025

What problem does this feature solve?

Currently, the normalizeHref function in the rspress repository transforms URLs in a way that may not be optimal for SEO. Specifically, it converts / to /index for clean URLs and / to /index.html for non-clean URLs. This behavior can lead to suboptimal SEO performance because canonical URLs (shorter and cleaner) are generally better for search engine rankings.

Current Behavior:

Clean URLs: / -> /index
Non-clean URLs: / -> /index.html

Proposed Changes:

Refactor the normalizeHref function to always use the root URL / instead of appending index or index.html.
Consider removing the cleanUrls option as it introduces non-optimal behavior from an SEO perspective.

Benefits:

  • Improved SEO by using canonical URLs.
  • Simplified URL structure, making it easier for users and search engines to understand.
  • Removal of redundant cleanUrls option, reducing potential confusion and misuse.

If you are ok I can create a PR for this changes

@Timeless0911
Copy link
Contributor

IMO, I think we also need to sort out and unify the concatenation of version / lang / /index / cleanUrl in the url. This is a more complicated matter and may require a certain amount of refactoring.

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

No branches or pull requests

2 participants