2

Say for example if I have a news site and my URL structure is:

example.com/news/random-article

If there is no page at example.com/news/, in other words it results in a 404 error, is that problematic from an SEO perspective for search engine crawlers?

The reason I ask is that the homepage is the actual "news" landing page, so I was thinking of using a permanent redirect to the homepage if the nonexistent page is a problem.

But I also want to preserve the possibility of eventually moving the "news" landing page to example.com/news/. Would a permanent redirect make it impossible to be indexed in the future?

3

This is an unpopular opinion, but I like to use a 302 redirect for a URL which both (1) has never been linked to or actually used for anything, and (2) is expected to change redirect destinations in the future. Since nobody is expected to visit it or link to it there will not be any SEO issue, yet that one guy who types it into their URL bar will end up at the right place (the home page).

A 301 specifies a permanent redirect that is never expected to change in the future. You can use a cache-control header to limit the caching length, but it still goes against the spirit of a 301. That's why I tend to lean towards using a 302 in situations like this, because while the redirect might be valid for a long time, it is still temporary because there is an expectation of it changing in the future.

I may well be wrong. I'm curious to hear others' opinions on this.

2

I very much agree with the reasoning provided by Maximillian Laumeister in his answer, but I would personally use a 303 status. 302 implies that the resource was "found" but elsewhere. Due to the industry and browsers regarding 302 as "see elsewhere" HTTP/1.1 added status codes 303 and 307 to distinguish between the two behaviours, where 303 is "see other" and 307 is "temporary redirect".

303 would imply that the resource exists, but in another url. 307 would imply that the resource used to exist at that url, but moved to another. Since the news section currently does not exist, I would use a 303 redirection to the home page to indicate that the content the user is seeking is available in another url. It is more clear and it upholds the HTTP documentation.

You can read more here, specifically this part:

A 303 response to a GET request indicates that the origin server does
not have a representation of the target resource that can be
transferred by the server over HTTP.  However, the Location field
value refers to a resource that is descriptive of the target
resource, such that making a retrieval request on that other resource
might result in a representation that is useful to recipients without
implying that it represents the original target resource.

So you can basically indicate that "hey, the specific url you are requesting does not match anything I can serve, but I am pretty sure you wanted to see something that is available in another url, check said url out".

This would let you redirect the /news url to your homepage without setting in stone that this url used to exist but moved to your homepage.

Also, and this is purely anecdotal, a 303 would make more sense if you plan to introduce a new url that contains the news in the future, because up to that point you are saying "I don't have that url, look this other url which is probably what you wanted in the first place" which is more clear than saying "I used to serve that URL, but I moved it to this other URL for now", the latter case implying that at some point in the past the example/news URL was actually serve-able from your end, which is not the case.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.