Download & Extend

Extra features - disable warning, 301 redirect instead of 302, custom page on no-results.

Project:Search 404
Version:6.x-1.x-dev
Component:Code
Category:feature request
Priority:normal
Assigned:zyxware
Status:closed (fixed)

Issue Summary

Hi! I've found this module very useful.

I've patched it for adding three more important features:

- Use a redirect 301 instead of redirect 302;
- Disable the warning message when an user is redirect to a search result;
- Custom page if no nodes has been found.

I use this features for SEO purposes. The patch is valid for version 6.x-1.7.

What do you think about this features?

AttachmentSize
search404_improvements.patch9.24 KB

Comments

#1

Probably the patch could be improved returning a 404 instead of a 301 for the custom page redirect.

#2

I've updated the patch: now it returns a 404 when it redirects to the custom page. Moreover I've fixed a small bug I've introduced.

AttachmentSize
search404_improvements-2.patch 9.26 KB

#3

Hi FiNeX

I have gone through the patch, here are my opinions on the 3 items introduced in the patch.

- Use a redirect 301 instead of redirect 302;

This is a feature requested by another user too, so I have implemented this in the latest dev commit of the Search404 module.

- Disable the warning message when an user is redirect to a search result;

Giving this option might confuse the end user, the user who gets into a Search404 based search result might not know why the he / she is getting a search result page when they have explicitly have given an URL on the top of the page. So I still have my doubts on implementing this as a feature in Search404.

- Custom page if no nodes has been found.

I am still thinking over this issue, I have not yet decided on how to implement his feature, may be this can be combined with this http://drupal.org/node/549134, since in both cases a node is shown in the search page and your scenario is a special case when no nodes are shown. In the thread I have given the node is embedded just below the search form. I will give you an update on this soon

Regards
Santhosh Raju

#4

Assigned to:Anonymous» zyxware
Status:needs review» needs work

#5

Hi! Thanks for looking my patch :-)

- Disable the warning message when an user is redirect to a search result;

It can be useful with the 301 redirect so if a user open a dead link, it is transparently redirected to an existing page which matches.

- Custom page if no nodes has been found.

I'm using this when nothing has been found: usually I send the user to a views wich display the most visited nodes. I print a "warning message" directly from the views, but this message could be configurable in the previous option... what do you think about?

#6

Hi! What do you think about the custom page redirect if no page has been found instead of the configurable message?

#7

Hi,

I'm both hands for the "Disable the warning message" feature. There won't be a confusion as we can always put a custom message there. But the default doesn't look good on sime sites.

Regards,
Serge

#8

Any possibility of getting patch #2 working with this modules latest version of 6.x-1.9? I tried several times, but I can't get the patch to apply cleanly.

#9

I second the request for a method to disable the "a search for %1 resulted in this page". I have it turned off on my current site, but I'm not feeling great about hacking up a contrib module.

My use case is the same as the one mentioned above: to handle dead links seamlessly after a large-scale site migration.

#10

Title:Patch for adding some extra features» Extra features - disable warning, 301 redirect instead of 302, custom page on no-results.
Version:6.x-1.7» 6.x-1.x-dev

The disable error message has been implemented in the latest dev version.

#11

Status:needs work» fixed

There is a problem with redirecting to a custom page when no nodes are found. This would return a status code of 301 or 302 defeating the purpose of the 404 status. Since the other two items have been taken care of I am marking this issue as fixed.

#12

Status:fixed» closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.