Copied to clipboard

Flag this post as spam?

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


  • Gregory 38 posts 128 karma points
    Nov 28, 2018 @ 14:06
    Gregory
    0

    URL Rewrite - Sitemap not working

    Hi there,

    Using Umbraco Cloud 7.12.4

    I am creating a dynamic sitemap via a macro. The sitemap is using the URL /sitemapxml

    I am trying to create a rewrite rule in the web.config to redirect /sitemap.xml to /sitemapxml

    I currently have the following:

    <rule name="Sitemap XML" enabled="true" stopProcessing="true">
                <match url="sitemap.xml" />
                <action type="Rewrite" url="sitemapxml" appendQueryString="false"/>
            </rule>
    

    The above does not seem to work. Obviously doing something wrong here, but after searching on the web for ages, I cannot quite figure out what the issue is.

    Also I have a few additional rules in my config file (for non www and https redirects).

    Any assistance would be much appreciated.

  • Dave Woestenborghs 3504 posts 12133 karma points MVP 8x admin c-trib
    Nov 28, 2018 @ 14:54
    Dave Woestenborghs
    100

    Hi Gregory,

    I have the following rewrite. My dynamic one is called /sitemap so you need to change that

    <rule name="Sitemap.xml rewrite" stopProcessing="true">
              <match url="^sitemap.xml$" />
              <action type="Rewrite" url="/sitemap" appendQueryString="false" />
    </rule>
    

    So the match is regex and the rewrite url starts with /

    Dave

  • Gregory 38 posts 128 karma points
    Nov 28, 2018 @ 16:48
    Gregory
    0

    Thanks a lot for that Dave.

    It is now working.

Please Sign in or register to post replies

Write your reply to:

Draft