If you are doing a search using the top level search box of your root site, it is a known limitation that you are always redirected to osssearchresults.aspx instead of the configured search center.

In order to redirect the search to the preferred search center, edit the Osssearchresults.aspx page. The Osssearchresults.aspx file is located on the web front-end server, in the following folder by default  \Program Files\Common Files\Microsoft Shared\web server extensions\12\TEMPLATE\LAYOUTS. Insert the code you see below before the “</script>” tag.

function getURLParam(strParamName)
{
var strReturn = “”;
var strHref = window.location.href;
if ( strHref.indexOf(”?”) > -1 )
{
var strQueryString = strHref.substr( strHref.indexOf( “?” ) ).toLowerCase();
var aQueryString = strQueryString.split( “&” );
for ( var iParam = 0; iParam < aQueryString.length; iParam++ )
{
if( aQueryString[iParam].indexOf(strParamName.toLowerCase() + “=”) > -1 )
{
var aParam = aQueryString[iParam].split(”=”);
strReturn = aParam[1];
break;
}
}
}
return strReturn;
}
var urlstring = ‘/SearchCenter/Pages/results.aspx?k=’ + getURLParam(’k') + ‘&cs=’ + getURLParam(’cs’) + ‘&u=’ + getURLParam(’u');
location.replace(urlstring);

  • Share/Save/Bookmark
Free wordpress templates | Free drupal themes | Free joomla themes | Free mediawiki templates | Free pligg templates | Web templates providers" | Professional Web Templates |

2 Responses to “Replace osssearchresults.aspx to SearchCenter”

  1. I really dont think you are right.

    If you are using MOSS then only it happens that way. Also try SiteActions > Search Center ( under site collection administration ) , to configure to any site you want

  2. The article is usefull for me. I’ll be coming back to your blog.

Leave a Reply

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>