# The response for an absent tag page should contain the «404» HTTP status code, not «200»

**URL:** https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438
**Category:** Bug
**Created:** [April 12, 2016, 9:46am UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438 "2016-04-12T09:46:43Z")
**Posts on this page:** 11
**Page:** 1

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [April 12, 2016, 9:46am UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/1 "2016-04-12T09:46:43Z")

</div>

![](https://global.discourse-cdn.com/meta/original/3X/c/5/c596c96edb44e255da722876c8f083ab7dc4ba82.png)

 ![](https://global.discourse-cdn.com/meta/original/3X/b/9/b990b71fbd118eb277b02751733d22825475c166.png)

> **[HTTP 404](https://en.wikipedia.org/wiki/HTTP_404#Phony_404_errors)**
>
> In HTTP, the 404 HTTP status code indicates that a web client (i.e. browser) was able to communicate with a server, but the server could not provide the requested resource. The server may not have the resource or it may not wish to disclose whether it has the resource. The code is often associated with response reason Not Found and is often referred to as page not found or file not found.
> Often, the server generates a web page for the condition and the client displays it, and often the content ...

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [April 12, 2016, 1:02pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/2 "2016-04-12T13:02:29Z")

</div>

At first this sounds good, but I’m not so sure. There is semantic knowledge in seeing that no posts exists for a tag. Does Google return a 404 when no results are returned from a search?

---

<div class="post-metadata">

### Author: ![dmitry\_fedyuk](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/dmitry_fedyuk/32/293153_2.png) [@dmitry\_fedyuk](https://meta.discourse.org/u/dmitry_fedyuk)
#### Post date: [April 12, 2016, 1:23pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/3 "2016-04-12T13:23:24Z")

</div>

Google returns “204” code:

> 204 No Content  
> The server successfully processed the request and is not returning any content.

---

<div class="post-metadata">

### Author: ![downey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/downey/32/166878_2.png) [@downey](https://meta.discourse.org/u/downey)
#### Post date: [April 12, 2016, 1:36pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/4 "2016-04-12T13:36:41Z")

</div>

That was what I was thinking about … Not sure if it’s 100% accurate either but looks like the best fit for this scenario…

---

<div class="post-metadata">

### Author: ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)
#### Post date: [April 12, 2016, 5:19pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/5 "2016-04-12T17:19:23Z")

</div>

I think a `404` is more appropriate here.

`204` means “your request was processed okay, and there is no result to show you”. That’s good for a search with no results, because you got what you asked for, it just turned out to be empty.

`404` means “what you’re looking for never existed or no longer exists”, which seems more suitable for a request for a specific topic (which turned out not to exist).

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 12, 2016, 9:34pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/6 "2016-04-12T21:34:27Z")

</div>

Sure sounds good @neil can you add this to your list on tagging?

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [April 12, 2016, 9:42pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/7 "2016-04-12T21:42:50Z")

</div>

I also wasn’t sure if a 20x or 40x error was better, but I now agree that 404 is better. On my list!

---

<div class="post-metadata">

### Author: ![riking](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/riking/32/170938_2.png) [@riking](https://meta.discourse.org/u/riking)
#### Post date: [April 12, 2016, 9:44pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/8 "2016-04-12T21:44:12Z")

</div>

204 is certainly wrong - 204 means you have a Content-Length of 0, i.e. no bytes returned.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [April 12, 2016, 9:53pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/9 "2016-04-12T21:53:40Z")

</div>

The 200 was ok I guess, because it meant that it was a valid tag name but nothing had been tagged with it yet. It’s more helpful to say 404 because the tag doesn’t exist.

---

<div class="post-metadata">

### Author: ![neil](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/neil/32/102150_2.png) [@neil](https://meta.discourse.org/u/neil)
#### Post date: [April 13, 2016, 8:09pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/10 "2016-04-13T20:09:51Z")

</div>

This was done today. Note that it’s still possible to get a 200 response with an empty topic list when filtered by both a category and an existing tag.

 ![](https://global.discourse-cdn.com/meta/original/3X/c/9/c925b14c5ed96a9aac1bc4ce9e1807cdbecc463d.png)

---

<div class="post-metadata">

### Author: ![codinghorror](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/codinghorror/32/110067_2.png) [@codinghorror](https://meta.discourse.org/u/codinghorror)
#### Post date: [April 13, 2016, 8:18pm UTC](https://meta.discourse.org/t/the-response-for-an-absent-tag-page-should-contain-the-404-http-status-code-not-200/42438/11 "2016-04-13T20:18:57Z")

</div>


