0

how do you append an additional url parameter to a link in your google search results? is it possible to do this within the style sheet?

for example i have domain.com/result.htm - i want to change the link to domain.com/result.htm?param=1

thank you

2 Answers 2

1

That´s quite simple. On the default stylesheet find this code snippet:

    <xsl:otherwise>
      <xsl:value-of disable-output-escaping='yes' select="U"/>
    </xsl:otherwise>

If you want to append a fixed param like in your example, changeit by:

    <xsl:otherwise>
      <xsl:value-of disable-output-escaping='yes' select="U"/>
      <xsl:value-of select="'?extra=param'"/>
    </xsl:otherwise>

This will append to any url a "?extra=param"

HTH

Sign up to request clarification or add additional context in comments.

2 Comments

thanks, i tried it but getting a error - "The reference to entity "testLink" must end with the ';' delimiter." any thoughts?
Hi, that´s because you entered an ampersand on the test url "&". Try replacing it with "&amp;". Just like: <xsl:value-of select="'?extra=param&amp;param2=value2'"/>
0

If google didn't crawl it like that, I don't think it's going to index it like that.

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.