View Single Post
Old October 19th, 2008, 02:05 PM   #1 (permalink)
Swanny
Member
Verified Customer
 
Swanny's Avatar
 
Join Date: Jun 2002
Location: Western Canada
Posts: 333
Expired items should return 404 HTTP error code

Hi,

I have a suggestion for PP Classifieds. Currently, when an item is expired and removed from the db, it shows this message: Product ID is no longer in our database. If you were trying to renew an ad, you will need to resubmit.. It only makes sense that when an item expires it produces the message.

The only downside to that is that Google indexes that expired page and may or may not eventually remove it from their index. The reason being is that Google has previously indexed the page when it had a product on it, now the content has changed (expired).

Specifically, the issue here is that search engines still index the page because it's returning a 200 OK HTTP status code. Since the product is no longer in the db it yields the same page (i.e. duplicate content) for multiple pages when it really should send a 404 Not Found HTTP status code because technically that page (product) no longer exists, and will never exist again.

I don't know exactly how to implement this, I may look into it myself if you guys can't implement this soon.

I know you can send 404 HTTP headers in php using code such as this [source link]:
Code:
Content visible to verified customers only.
Is it feasible to send that header code if the product is not found in the database? It would help search engines know "hey, this file doesn't exist, so let's take it out of our index".

The result is better (cleaner, more relevant) search indexes by the search engines and better search results for end users (because they won't see those pages listed in search engine results anymore). A win-win situation.

Please consider this for a future release. Like I said when I get time I may poke around and see if it's possible but you guys probably have a better idea of what templates, php files, etc. to edit to make this magic happen. Heck, even if you tell me what files I should edit I can look around myself. Just trying to help!
Swanny is offline   Reply With Quote