I have renamed the enterprise search center url from /xxxxx/Search to /xxxxx/WebSearch

Search from root site top navigation search dropdown takes to https://xxxxx/WebSearch, which is good. But search from any subsite takes it to https://xxxxx/Search and we get page not found error. How to fix this without going to each subsite and doing any changes, because we have a lot of subsites in the site collection.

3 Answers 3


Check your Search Service Application. There is a setting for the Global Search Center URL. It is likely pointing to the old location.


I think if your sub-site settings are set to inherit from Parent then it will automatically update it. Another way is use the powershell to update for all at once.

function SetSearchSettingsSite($siteUrl,$searchCenterUrl,$resultPagesUrl)
 $site = Get-SPSite $siteUrl
 $site.AllWebs | ForEach-Object {
 $web = $_
 $web.AllProperties["SRCH_SB_SET_WEB"] = '{"Inherit":false,"ResultsPageAddress":"'+$resultPagesUrl+'","ShowNavigation":false}'
 $web.AllProperties["SRCH_ENH_FTR_URL_WEB"] = $searchCenterUrl

Read more about above code here: Update Search Settings using Powershell in SharePoint 2013

Also check this one http://sharepoint.jsturges.com/2012/02/update-search-center-for-all-sites-in-a-web-application/

  • Thanks. Subsites are already inheriting from parent. I disabled and enabled inheritting manually for a subsite, it didnt work. I can try the script in the links.
    – Venkat
    Jul 22, 2016 at 14:06

This worked.

$webs= get-spsite $spSitecollection | Get-SPWeb -Limit all | where {$_.serverrelativeurl -ne "/xxxSearch"} | select serverrelativeurl

foreach ($element in $webs) {
       $web=get-spweb $relURL
    #delete existing link
       $navs = $web.Navigation.SearchNav
       foreach ($nav in $navs)
             $nodeid =$web.Navigation.GetNodeById($nav.Id)
             write-host "$($nodeid.title) add id $($nodeid.Id) to array"  
       foreach ($node in $navItems)
             write-host "delete id $($node.Id)"    
$titleTHISSITE="This Site"
       $relativeURLTHISSITE=$element.serverrelativeurl + "/_layouts/15/osssearchresults.aspx?u=$($relURL)"
       $nodeTHISSITE=new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $TitleTHISSITE, $RelativeUrlTHISSITE, $true 
       $relativeURLEVERYTHING=$serverrelativeurl + "/xxxSearch/Pages/results.aspx"
       $nodeEVERYTHING=new-object -TypeName "Microsoft.SharePoint.Navigation.SPNavigationNode" -ArgumentList $TitleEVERYTHING, $RelativeUrlEVERYTHING, $true 


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.