Microsoft Office Sharepoint

All my posts are provided "AS IS" with no warranties, and confer no rights.

How to remove something (the port) from the URL as returned in the search results (searchresults.aspx):

How to remove something (the port) from the URL as returned in the search results (searchresults.aspx):

  • Comments 7
  • Likes

How to remove something (the port) from the URL as returned in the search results (searchresults.aspx):


UPDATE : the behavior depicted below should not happen after installing October 2009 Cumulative Update package:


Download October 2009 Server-Package for WSS (974989)


Download October 2009 Server-Package for MOSS 2007 (974988)

If you have not upgraded or need a workaround, read on:



Starting with the Infrastructure update, the following behavior can be encountered when searching for people:

The port (usually 80) is appended to the URL of the location for each result, resulting in error for all the internet facing personal sites.

For example, imagine you published your my site location in Alternate Access Mappings at : to be accessed from the intranet and  to be accessed from the internet.


When you are searching for a user when logged on from the internet side of things, you will receive the results pointing to which will throw an error upon accessing (page not found).


If you want to overcome the issue (eg, you are looking for a quick fix) here's what you can do:


Go to your search center with tabs and search for something, just to get to the people results page.

Edit the page and modify the People Search Core Results web-part.

Click on the XSL Editor button to get to the XSL style sheet applied to the resultset.

The URL for each result is under the following section:


<!-- This template is called for each result -->


<xsl:template match="All_Results/Result">

<xsl:variable name="id" select="id"/>


here ,


replace <xsl:variable name ="url" select ="url"/> line with:



<xsl:variable name ="temp" select ="url"/> <!-- We put the url value from the resultset in temp variable -->

            <xsl:variable name="url"> <!-- This will be the value used in the xsl from now on in this section as $url -->


                        <xsl:when test="contains($temp,':80')">  <!--We check temp variable  for the occurrences of string :80-->

                        <xsl:value-of select ="concat(substring-before($temp,':80'),substring-after($temp,':80'))"/>

                                    <!--We remove from temp variable  the occurrences of string :80-->



                        <xsl:value-of select ="$temp"/> <!--If we did not find the :80 we will retain the default value (url) as defined above-->








So from now on, wherever we will use $url we will have the translated version of the url returned in the resultset

eg.  for the result would be


Of course you will also need to play with the Search High Confidence Results web Part to Edit it  accordingly.

The place where you need to replace the url is :


<xsl:template match="All_Results/HighConfidenceResults/Result">

                                <xsl:if test="$DisplayHC = 'True' and $IsFirstPage = 'True'" >

                                                <xsl:variable name="prefix">IMNRC('</xsl:variable>

                                                <xsl:variable name="suffix">')</xsl:variable>

                                                <xsl:variable name="url" select="url"/>

                                                <xsl:variable name="id" select="id"/>


replace <xsl:variable name ="url" select ="url"/> line as above


Here are some additional references on how to edit, and tune the search  results to fit your company needs:





  • PingBack from

  • Thanks a bunch! I was wondering what happened to my people search.

  • Hi,

    I am not able to edit the searchresult page, so that i can edit the people search core result webpart and change the xslt to replace the ":80".

    it's not that page is checkout by some one , even it's not giving option to override the change checked out by some one.

    also the page is not checked out by some one.

    simple the page edit is disabled in the site action menu.

    need a quick help!

  • This usually can mean two things:

    either you do not have the proper rights to edit the page, or the menu entry was customized somehow.

    By default, the page should be editable by the site collection owners ,the administrators and generally by the people having designe rights on the site

  • Thank you so much for posting this. This issue was driving me crazy.

  • It would be good if you could point towards or outline what the "correct" fix would be.


  • As said in the beginning of the post, the behavior was addressed and solved with  October 2009 Cumulative updates

Your comment has been posted.   Close
Thank you, your comment requires moderation so it may take a while to appear.   Close
Leave a Comment