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

Sitemap has trailing slash for homepage #173

Open
davidvkimball opened this issue Sep 4, 2024 · 3 comments
Open

Sitemap has trailing slash for homepage #173

davidvkimball opened this issue Sep 4, 2024 · 3 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@davidvkimball
Copy link
Contributor

I believe the problem is related to this issue, but wasn't quite sure how to implement the fix.

The homepage has a trailing slash for the first page, which is a problem for SEO because Google / other search engines think it's a different page since the default version of the homepage does not have a trailing slash.

Any idea how we fix?

@saicaca saicaca added bug Something isn't working help wanted Extra attention is needed labels Sep 6, 2024
@saicaca
Copy link
Owner

saicaca commented Sep 6, 2024

Not sure how to fix this issue for now.

Btw, I noticed the issue also appears on https://astro.build/sitemap-0.xml.

@L4Ph
Copy link
Contributor

L4Ph commented Sep 27, 2024

@saicaca

import { defineConfig } from "astro/config";
import sitemap from "@astrojs/sitemap";

// https://astro.build/config
export default defineConfig({
	site: "https://kb.l4ph.moe",
	trailingSlash: "never",
	integrations: [sitemap()]
});

As mentioned above, it seems that the problem can be solved by setting trailingSlash: "never", but I think that doing this is likely to cause problems with the application itself, so I will investigate this a bit myself.

@L4Ph
Copy link
Contributor

L4Ph commented Oct 29, 2024

@davidvkimball
Could you please tell me what behavior you would like to see?
If you probably want to be strict and set it yourself, using trailingSlash: "never" should solve the problem.
https://docs.astro.build/en/reference/configuration-reference/#trailingslash

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants