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?

Comments

finex’s picture

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

finex’s picture

StatusFileSize
new9.26 KB

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.

zyxware’s picture

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

zyxware’s picture

Assigned: Unassigned » zyxware
Status: Needs review » Needs work
finex’s picture

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?

finex’s picture

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

serg.remote’s picture

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

bryancasler’s picture

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.

CatherineOmega’s picture

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.

zyxware’s picture

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.

zyxware’s picture

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.

Status: Fixed » Closed (fixed)

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