Copied to clipboard

Flag this post as spam?

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


  • paco 25 posts 155 karma points
    Oct 19, 2020 @ 09:33
    paco
    0

    Rewrite rules in umbraco multilanguage site

    Hello,

    I have an Umbraco 8.x multilanguage site (English and Italian) and I have an issue with redirect rules.

    I have created a file (rewriteRulse.config) and defined two rules for sitemap.xml and robots.txt files, so thet, when you browse https://www.mysite.com/sitemap.xml, the rule rewrite this URL to https://www.mysite.com/sitemapxml. (and same thing for robots.txt)

    For the English content, these two rules work perfectly, but, for the italian content, I am redirected to English sitemap and/or robots file.

    These are the rules I defined inside my rewriteRules.config file:

     <?xml version="1.0" encoding="utf-8"?>
    <rules>
      <rule name="SiteMap" stopProcessing="false">
        <match url="sitemap.xml" ignoreCase="true" />
        <action type="Rewrite" url="sitemapxml" appendQueryString="false"  />
      </rule>
      <rules>
      <rule name="SiteMapIT" stopProcessing="true">
        <match url="/it/sitemap.xml" ignoreCase="true" />
        <action type="Rewrite" url="/it/sitemapxml" appendQueryString="false"  />
      </rule>
      <rule name="Robots" stopProcessing="false">
        <match url="robots.txt" ignoreCase="true" />
        <action type="Rewrite" url="robotstxt" appendQueryString="false"  />
      </rule>
     <rule name="RobotsIT" stopProcessing="true">
        <match url="/it/robots.txt" ignoreCase="true" />
        <action type="Rewrite" url="/it/robotstxt" appendQueryString="false"  />
      </rule>
    </rules> 
    

    And I have called them inside my Web.config:

       <!--
                If you wish to use IIS rewrite rules, see the documentation here: https://our.umbraco.com/documentation/Reference/Routing/IISRewriteRules
            -->
        <rewrite>
          <rules configSource="config\rewriteRules.config" />
        </rewrite>
    

    What went wrong?

    Thanks, paco

  • 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