fuwari icon indicating copy to clipboard operation
fuwari copied to clipboard

Sitemap has trailing slash for homepage

Open davidvkimball opened this issue 1 year ago • 4 comments

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?

davidvkimball avatar Sep 04 '24 22:09 davidvkimball

Not sure how to fix this issue for now.

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

saicaca avatar Sep 06 '24 17:09 saicaca

@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 avatar Sep 27 '24 07:09 L4Ph

@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

L4Ph avatar Oct 29 '24 10:10 L4Ph

@L4Ph in xhtmllink we have 'end slash', it's problem image

arastorhuiev avatar Jan 06 '25 18:01 arastorhuiev