Copied to clipboard

Flag this post as spam?

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


  • Adrian Wu 53 posts 266 karma points
    Jan 22, 2019 @ 02:31
    Adrian Wu
    0

    any way to rewrite the url for a page ?

    Hi , guys,

    umbraco saves my page name "sitemap.xml" name as "sitemapxml" thus the url will be http://www.mydomain.com/sitemapxml. http://www.mydomain.com/sitemapxml is pulling some dynamic data from CMS.

    How can I change it to http://www.mydomain.com/sitemap.xml ?

    Thanks,

    A

  • Alex Skrypnyk 6182 posts 24284 karma points MVP 8x admin c-trib
    Jan 30, 2019 @ 08:48
    Alex Skrypnyk
    100

    Hi Adrian

    Use rewrite rule for this case:

    <rule name="SiteMap" patternSyntax="Wildcard" stopProcessing="true">
        <match url="sitemap.xml" />
        <action type="Rewrite" url="sitemap" appendQueryString="false" />       
    </rule>
    

    Alex

  • Adrian Wu 53 posts 266 karma points
    Jan 31, 2019 @ 19:48
    Adrian Wu
    0

    Yes right.

    But I need to install this https://www.iis.net/downloads/microsoft/url-rewrite first then the rewrite rule will be working in localhost while Azure is working without installing it.

    Thanks,

    A

  • Dan Diplo 1554 posts 6205 karma points MVP 6x c-trib
    Jan 30, 2019 @ 13:18
    Dan Diplo
    2

    A valid sitemap doesn't need to have an .xml extension - what it does need, though, is to return the content as a valid XML document with the correct content-type (i.e. text/xml)

    https://webmasters.stackexchange.com/questions/49589/sitemap-xml-file-extension-does-it-have-to-be-xml

  • Adrian Wu 53 posts 266 karma points
    Jan 31, 2019 @ 19:41
    Adrian Wu
    0

    yes, right. I also showed these two links to my client saying that .xml is irrelevant. https://codeshare.co.uk/xmlsitemap https://codeshare.co.uk/robots.txt

    But they still insist needing that .xml lol.

    Thanks anyway.

    A

  • Josip 195 posts 662 karma points c-trib
    Jan 30, 2019 @ 14:00
    Josip
    1

    This is how i do it:

        <rewrite>
        <rules>
          <!--Rewrite for XMLSitemap -->
          <rule name="Sitemap.xml rewrite" stopProcessing="true">
            <match url="^sitemap.xml$" />
            <action type="Rewrite" url="/sitemap-xml/" appendQueryString="false" />
          </rule>
        </rules>
      </rewrite>
    
  • Adrian Wu 53 posts 266 karma points
    Jan 31, 2019 @ 19:45
    Adrian Wu
    0

    Yes it works.

    Thanks,

    A

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies