Copied to clipboard

Flag this post as spam?

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


  • Jesse Andrews 191 posts 716 karma points c-trib
    Feb 26, 2020 @ 01:17
    Jesse Andrews
    0

    Is there a way to restrict paths url rewrite is applied to?

    Umbraco Version: 8.5.3

    SEO Checker Version: 2.9.0

    I'm running into problems with ucommerce because seo checker is forcing its api requests in the backoffice to lower case. Normally this isn't an issue, but ucommerce's api is case sensitive and doesn't follow umbraco conventions. For example

    /ucommerceapi/Content/tree/Children/productCatalogGroup/14
    

    works, but

    /ucommerceapi/content/tree/children/productcataloggroup/14
    

    does not. Is there a configuration option in seo checker to exclude certain paths from being rewritten? If not I can just disable it in the config and add in my own rules to address this.

  • Richard Soeteman 4047 posts 12900 karma points MVP 2x
    Feb 26, 2020 @ 07:05
    Richard Soeteman
    0

    Hi Jesse,

    SEOChecker will ignore path's that are added to Umbraco.Core.ReservedPaths setting in web.config. So if you add /ucommerceapi/ to that setting all should be fine again.

    Best,

    Richard

  • Jesse Andrews 191 posts 716 karma points c-trib
    Feb 26, 2020 @ 17:00
    Jesse Andrews
    0

    Originally, it had "~/ucommerceapi" as the reserved path. I tried using "/ucommerceapi/" and "/ucommerceapi" there, but the api call is still forced to lowercase.

  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 09, 2020 @ 18:07
    Jesse Andrews
    100

    Ended up just adding my own redirects in the web config. Not sure why seo checker is still applying the redirects in the backoffice for seo checker after I set the reserved paths. It might be because the whole ucommerce tab lives within an iframe, so it could be bypassing some of the umbraco bits that seo checker needs in order to redirect properly.

  • Johan Reitsma 68 posts 234 karma points MVP
    Jun 09, 2020 @ 19:41
    Johan Reitsma
    0

    Could you share your fix? Because im having the same issue. Thanks

  • Jesse Andrews 191 posts 716 karma points c-trib
    Jun 09, 2020 @ 19:56
    Jesse Andrews
    0

    Sure, I did two things.

    First, I disabled seo checker's url rewriting in /App_Plugins/SEOChecker/config/SEOChecker.config. This makes ucommerce work, but loses the general redirects that seo checker adds. The urlRewrite tag should be as follows.

    <urlRewrite enableUrlRewriting="false" forcewwwUrls="Ignore" useTrailingSlashProperty="True" />
    

    Settings "enableUrlRewriting" to false disables SEO Checker's general redirects.

    Then I added a couple rules to the web config to reproduce a couple of the redirects that SEO Checker normally handles.

    <rule name="Force lower case" stopProcessing="false">
      <match url="(.*)"/>
      <conditions>
        <add input="{R:1}" pattern="^umbraco|ucommerceapi|app_plugins|media" negate="true"/>
        <add input="{URL}" pattern="[A-Z]" ignoreCase="false" />
      </conditions>
      <action type="Redirect" url="{Tolower:{R:0}}" appendQueryString="true" redirectType="Permanent"/>
    </rule>
    <rule name="Force trailing slash" stopProcessing="false">
      <match url="(.*[^/])$"/>
      <conditions>
        <add input="{R:1}" pattern="^umbraco|ucommerceapi|app_plugins|media" negate="true"/>
        <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
        <add input="{REQUEST_FILENAME}" pattern="(.*?)\.html$" negate="true" />
        <add input="{REQUEST_FILENAME}" pattern="(.*?)\.aspx$" negate="true" />
        <add input="{REQUEST_FILENAME}" pattern="(.*?)\.axd" negate="true" />
      </conditions>
      <action type="Redirect" url="{R:1}/" appendQueryString="true" redirectType="Permanent"/>
    </rule>
    

    You may need to tinker with the conditions a bit to get it to work in your case, but this it what I've done. It's not perfect, but better than nothing.

  • Richard Soeteman 4047 posts 12900 karma points MVP 2x
    Jun 10, 2020 @ 06:14
    Richard Soeteman
    0

    Hi All,

    If you use this version https://www.dropbox.com/s/ioplivqtoyng4bp/seo-checker29_1.zip?dl=0 The umbracoreservedPath is working.

    Will try to make this a release next week.

    Best,

    Richard

Please Sign in or register to post replies

Write your reply to:

Draft