URL Rewrite / Enforce lowercase URLs

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
8 years ago
We use IIS 8 and we try apply role for URL Reprieve plugin Enforce lowercase URLs.
After applying this role website run fine but not able to to thru checkout and in Administration no access to any data.
Anybody have idea why or how to fix it?
8 years ago
Sure. I encountered the same challenge (with admin and checkout). Give this a try. You simply need to exclude specific folders, these folders will not matter in SEO anyway.

          <rule name="Force Lower Case" enabled="true" stopProcessing="false">
            <match url="[A-Z]" ignoreCase="false" />
            <action type="Redirect" url="{ToLower:{URL}}" />
            <conditions>
              <add input="{URL}" pattern="^/checkout" negate="true" />
              <add input="{URL}" pattern="^/content" negate="true" />
              <add input="{URL}" pattern="^/admin" negate="true" />              
              <add input="{URL}" pattern="^/Administration" negate="true" />
              <add input="{URL}" pattern="^/Scripts" negate="true" />
              <add input="{URL}" pattern="^/Themes" negate="true" />
            </conditions>
          </rule>
8 years ago
We also did this and since we use a lot of nop-template plugins, extended the exclusion rules. Ours looks like this:


<rule name="LowerCaseRule1" stopProcessing="true">
  <match url="[A-Z]" ignoreCase="false" />
  <conditions>
    <add input="{URL}" pattern="^/Content" negate="true" />
    <add input="{URL}" pattern="^/Admin" negate="true" />
    <add input="{URL}" pattern="^/Administration" negate="true" />
    <add input="{URL}" pattern="^/Scripts" negate="true" />
    <add input="{URL}" pattern="^/Themes" negate="true" />
    <add input="{URL}" pattern="^/Plugins" negate="true" />
    <add input="{URL}" pattern="^/ShoppingCart" negate="true" />
    <add input="{URL}" pattern="^/NopAjaxCart" negate="true" />
    <add input="{URL}" pattern="^/ProductRibbons" negate="true" />
    <add input="{URL}" pattern="^/MiscPageRedirect" negate="true" />
    <add input="{URL}" pattern="^/Catalog7Spikes/" negate="true" />
    <add input="{URL}" pattern="^/TaxCountryStateZip/" negate="true" />
  </conditions>
  <action type="Redirect" url="{ToLower:{URL}}" redirectType="Permanent" />
</rule>
6 years ago
Hi

I added this code and it seemed to work for all apart from smart product collections. So I added:

<add input="{URL}" pattern="^/SmartProductCollections/" negate="true" />

Sorted it.

BUT

I have now seen that the NopAjaxCart pop up is not working, so nothing can be added to the basket. I have tried a few variations but to no avail.

Has anyone come across this issue and fixed it?

Thanks

Peter
5 years ago
I strongly suggest staying away from NopCommerce version 4.1.  While the site works well, you will encounter a ton of SEO issues in Google, including the lowercase vs uppercase.

You can try to rewrite the URLs using IISRewrite, but it will break your javascript.
5 years ago
The best thing to do is change all the URLs to lowercase by customizing nopCommerce core.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.