Deafult views in the Views 2 Module have an SEO issue. They don't send 404 errors when a non-existent URL is requested.

For example, if your view is located at
example.com/articles

and your page is at:
example.com/articles/my-page

but you accidentally link to:
example.com/articles/mypage

Drupal sends a "200 OK" header and the content from:
example.com/articles

instead of sending a 404 header/page.

Is there a way to fix that in the Views settings or should I add an issue to the Views module?

Comments

Target-Tom’s picture

Same Problem here. This is really a big Problem because it creates duplicate pages with no content. Especially when you change your URL-structure.

Webdesign, Marketing & SEO
Target-Traffic media

Target-Tom’s picture

As i needed a quick solution i figured a workaround. Just use a name other than the "directory" for the view.

For Example:

example.com/articles/myexistingpage > 200
example.com/articles/mynonexistingpage > 404
example.com/articles/ > 404
example.com/articles/view > 200

Webdesign, Marketing & SEO
Target-Traffic media

Slovak’s picture

The solution is to edit the view by adding an Argument of Node: Nid. Set it to "Display all values", Validator: Node, and Argument type of Node ID. Set Action to take if argument does not validate: to Hide view / Page not found (404). Update the Argument and save the view.

Detailed post at http://peterpetrik.com/blog/2009/11/non-existent-urls-views-2

xsean’s picture

i create a new content/page with url alias http://www.example.com/test

when i key in invalid url http://www.example.com/text/invalid, it suppose go to 404 page but it show same thing like the page from http://www.example.com/test

FranCarstens’s picture

Unfortunately this doesn't seem to work when you have other arguments.

I have a "term name" argument that should give me /folder/term, but also gives me /folder/whatever/whatever/whatever. Adding the "node ID" kills all my "/folder/terms".

Shame... I'm kind of desperate for a solution. (Unfortunately this is still a D5 system so Views 404 won't work.)

-- If no-one asked Drupal questions there would be no Drupal answers --

mikeytown2’s picture

Give it a try, it should solve the views 404 issue.
http://drupal.org/project/views404