Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Barry 99 posts 187 karma points
    Sep 28, 2009 @ 14:04
    Barry
    0

    Canonical tags

    I found this post

    http://our.umbraco.org/wiki/how-tos/create-canonical-urls-using-xslt-macro

     

    And tried to use the XSLT there by copying and pasting it. Umbraco wont allow me to save it. Does anybody know why? THis is the XSLT:

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:Stylesheet [ <!ENTITY nbsp "&#x00A0;"> ]>
    <xsl:stylesheet        
            version="1.0"        
            xmlns:xsl="http://www.w3.org/1999/XSL/Transform"        
            xmlns:msxml="urn:schemas-microsoft-com:xslt"
            xmlns:umbraco.library="urn:umbraco.library"
             exclude-result-prefixes="msxml umbraco.library">
            <xsl:output method="xml" omit-xml-declaration="yes"/>
            <xsl:param name="currentPage"/>
            <xsl:template match="/">
                    <xsl:choose>
                            <xsl:when test="starts-with(umbraco.library:RequestServerVariables('HTTP_HOST'),'www')">
                                    <xsl:variable name="url" select="concat('http://',umbraco.library:RequestServerVariables('HTTP_HOST'))" />
                                    <link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" />
                            </xsl:when>
                            <xsl:otherwise>
                                    <xsl:variable name="url" select="concat('http://www.',umbraco.library:RequestServerVariables('HTTP_HOST'))" />
                                    <link rel="canonical" href="{$url}{umbraco.library:NiceUrl($currentPage/@id)}" />
                            </xsl:otherwise>
                    </xsl:choose>
            </xsl:template>
    </xsl:stylesheet>

     

  • Barry 99 posts 187 karma points
    Sep 28, 2009 @ 14:19
    Barry
    0

    Its ok , I sorted it . If I have "test this xslt" ticked.. it doesnt allow me to save.. as long as its unticked it works fine and saves.

Please Sign in or register to post replies

Write your reply to:

Draft