From mboxrd@z Thu Jan 1 00:00:00 1970 From: normalperson at yhbt.net (Eric Wong) Date: Sun, 15 May 2016 11:17:37 +0000 Subject: trailing slash page canonicalization In-Reply-To: References: Message-ID: <20160515111736.GA4599@dcvr.yhbt.net> "Jason A. Donenfeld" wrote: > We have another potential issue, however. git.zx2c4.com/cgit and > git.zx2c4.com/cgit/ have the same content, yet different URLs. This > might be looked upon unfavorably by search engines. One rectification > is to add a meta tag. Another, and one I'd like to consider here, is > to always add the trailing slash to pages with the same 301 trick as > [1]. I think canonicalizing is a good idea to improve cacheability, too. For HTML, I favor trailing slash for consideration with people who want to mirror to a static site (e.g. with "wget -r -np"). That results in "$DOCROOT/foo/index.html" on the FS; making it easy for common configurations of static HTTP servers to serve for "/foo/" using the "$DOCROOT/foo/index.html" file. Without the trailing slash, "wget -r -np" would create a "$DOCROOT/foo" file, and it's not easy to serve the right Content-Type with a static file server that way.