I am us a 'SearchBoxEX' control on my site. Since my site has a language variation, I use a resource files to specify the 'SearchResultPageURL' property.

The page is located on the root of each variation:

ie. "http://.../en-US/SearchResults.aspx" ie. "http://.../fr-FR/SearchResults.aspx"

How do I specify the URL in my resource such that it is a relative URL that will always point to the correct 'SearchResults.aspx' regardless on which sub-site I may be on.


As far as I am aware that needs to be set at site collection level.


PowerShell script to do it.

$site = Get—SPSite "http://[site]"
foreach ($web in $site.Allwebs) {
    Write—Host "Modifying all search result pages in site ($($web.Url))"
    $web.AllProperties["SRCH_ENH_FTR_URL"] = http://[searchsite]/

Also: You can also set this to happen on a Web Provisioned event receiver for new webs.

  • There are two different pages, depending on whether sites exist under the variation or not. It is up and running, however I specify the full URL to the page. If I ever change IP for example, I will need to update the resource file. How would I, for example, specify a link on a page to always go to the root-site level, without specifying the entire URL? Dec 3 '12 at 17:21
  • 1
    Why don't you use relative URLs? Under /_layouts/enhancedSearch.aspx "Example: /SearchCenter/Pages or server/sites/SearchCenter/Pages"
    – Hugh Wood
    Dec 3 '12 at 17:29
  • I had tried that, turns out I forgot the initial "/". Thanks, for the help. Dec 3 '12 at 17:49

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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