Non-existent ?page parameter doesn't redirect/404


(Fred Kelly) #1

Hola!

We are noticing that duplicate pages have started being indexed by Google, for example:

curl -I -L http://mydiscourse.com/t/this-is-a-test-topic/1
=> HTTP/1.1 200 OK

and

http://mydiscourse.com/t/this-is-a-test-topic/1?page=5000000
=> HTTP/1.1 200 OK

Ideally the latter (non-existent) URL should 404 or redirect, it seems the current behaviour is to render the correct (former) URL, but with a status 200 (unless I’m mistaken).

This is running v0.9.9.9, though I notice the same behaviour is present on meta.discourse.org which I assume is running a newer release.

Any help appreciated; apologies if there is an obvious solution.


(Sam Saffron) #2

putting this down as a bug, we should be 404ing stuff that is out of range.


(Sam Saffron) #3

Just committed a fix for this:

https://github.com/discourse/discourse/commit/8c74255cbb051ddd24e3bbc8b9fc83bc6f6db68e


(Jeff Atwood) #4