Redirect a 404 page to search plugin

This plugin is meant to 'catch' broken URLs still listed in Google. If a 404 message comes up, this plugin checks for a referrer, and if that contains a search query (q=...) it redirects to the search plugin.


  • Upload files to /plugins
  • Install through admin panel
  • Optionally: edit search plugin (see below)

» Discuss here

The plugin passes the Google query to the search plugin, but since the current search plugin doesn't support queries though GET, it won't show them. If you want them to show, you have to edit your search plugin:

In plugins/search/search.php, at line 29 you have this:

$sq = sed_import('sq','P','TXT',$cfg['plugin']['search']['maxsigns']);

Below that line, add this:

$q = sed_import('q','G','TXT',$cfg['plugin']['search']['maxsigns']);
if(!$sq && $q) $sq = $q;

Around line 39, you have:

$a = sed_import('a','P','ALP');

Below that, add this line:

if(!$sq && $q) $a = 'search';

In the future I may rewrite the search plugin to use GET instead of POST.

No comments yet
Only registered users can post new comments