3 ms·
> SEO: if your content exists at two (or more!) distinct URL endpoints, it is a SEO no-no. […] You need redirects. Or you could just only serve it from one of
by chrismorgan 5y ago
> SEO: if your content exists at two (or more!) distinct URL endpoints, it is a SEO no-no. […] You need redirects.
Or you could just only serve it from one of the two URLs and let the other 404. (Yeah, static file servers don’t tend to be fond of working this way, but it’s not an unreasonable option if you’re forming a matrix of fundamental possibilities. And indeed, in the analysis, it’s what half the servers do at least some of the time; and it’s what all standard static file serving software that I know does out of the box.)
> Vercel, Render, and Azure Static Web Apps: slashless /resource returns content [from resource/index.html] but without redirects, resulting in multiple endpoints for the same content.
This is obviously Wrong with a capital W because of how it breaks relative URLs in the file. Surely it should just be considered a bug and fixed (probably to redirect to /resource/)?
> Almost everyone agrees that /resource should return content from resource.html
This is a biased view because you’re only considering mildly-opinionated static file servers and their configuration. If you’re serving it yourself with things like nginx or Apache httpd, you won’t get this out of the box and must opt into it. (No idea about others like Caddy.)
> (When both resource.html and resource/index.html are present and /resource/ is requested.) Netlify redirects to /resource instead.
I say of this too that it is obviously a bug. Netlify isn’t just taking an opinionated stance, it’s doing what is fairly unequivocally the Wrong Thing.
- hunter2_ 5y ago> with things like nginx or Apache httpd, you won’t get this out of the box and must opt into it For anyone wondering, in Apache this can be done with MultiViews [0], which is kind of nifty, but also a can of worms. I find it interesting that TFA says "when resource.html and resource/index.html both exist ... Everyone agrees that /resource should return content from resource.html" but it seems like [1] MultiViews works the opposite way: "if the server receives a request for /some/dir/foo, if /some/dir has MultiViews enabled, and /some/dir/foo does not exist, then the server reads the directory looking for files named foo.*" [0]. [0] https://httpd.apache.org/docs/2.4/content-negotiation.html#multiviews https://httpd.apache.org/docs/2.4/content-negotiation.html#m... [1] I could be misinterpreting the doc. I haven't tested the actual behavior of httpd to know exactly what happens in a no-trailing-slash request of this nature.
- putlake 5y ago>> SEO: if your content exists at two (or more!) distinct URL endpoints, it is a SEO no-no. […] You need redirects. > Or you could just only serve it from one of the two URLs and let the other 404. That's not a good idea. The URL you are choosing to remove may have built up some link equity, which you will lose if you 404 it. Instead of 404ing it, 301 redirect to the surviving URL. This allows search engines to consolidate equity from both URLs into one.
- Gustomaximus 5y agoThis + better user experience if external sites are linking into both page versions. You dont want one group getting 404 when you could quickly get them to the correct page. As a rule if a page has traffic it should be redirected to the next best when being removed, even if its a old promo page that's not relevant etc.
- chrismorgan 5y agoI’m not saying remove a URL; that would of course be wrong. I’m saying not to have used it in the first place.
- hypertele-Xii 5y ago> SEO: if your content exists at two (or more!) distinct URL endpoints, it is a SEO no-no. […] You need redirects. No you don't. <link rel='canonical' href='whatever form you want your URL to have' />
- chrismorgan 5y ago(You’re responding to a point in the original article, not a point I made. I contemplated mentioning <link rel=canonical> myself, but others have also already mentioned it in the thread so I didn’t bother.)