Thursday, March 15, 2012

Change default SearchResultPageURL in Search SharePoint 2010

In this post we will discuss how to Change default SearchResultPageURL in Search SharePoint 2010. Also you can check my previous posts on:

- Query Search with SharePoint 2013 server object model

- Backup and Restore Site Collections in SharePoint 2010 using PowerShell

- Change page layout programmatically SharePoint 2010

By default if you click on search button in SharePoint 2010, it will rediect to osssearchresults.aspx page. But suppose you want to redirect to a different page then there are different ways to do that. Here also I have posted the tread in the forum Change SearchResultPageURL in Search.

Basically these search box is nothing but a SharePoint feature namely as OSearchBasicFeature which is located in the feature directory. C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\FEATURES. If you will open the folder then you will the SearchArea.xml file.

And there is a tag name as
<PropertyName="SearchResultPageURL">/_layouts/osssearchresults.aspx</Property> which is responsible for the page.

You can make you own custom feature with a sequence less than the out of box feature.
But the simplest way to found it is change from the browser.

Go to Site Actions -> Site Settings. It will open the settings page.

Navigate to the Site Collection Administration and click one Search settings.

From the search settings page in the Site Collection Search Results Page section you can change the path as shown in the figure below.