CFF KB - Carrz-Fox-Fire Promotions Knowledge Base

CFF KB is all about 1 thing: The Sharing of Knowledge and the Power we gain from it.
  • Breadrumbs:
  • URL Rewrite Rule causes 500 Error in web.config

  • CFF Knowledge Base - Share With Facebook CFF Knowledge Base - Share on Twitter CFF Knowledge Base - Share on Reddit CFF Knowledge Base - Share on Digg It CFF Knowledge Base - Share on Stumble Upon It CFF Knowledge Base - Share on Delicious
    Share With Friends (Updated 6-8-2010)
  • Article ID:
    7270
  • Date Created
    Wednesday, March 6, 2024
  • Last Updated
    Wednesday, March 6, 2024
  • This Article Has been Viewed
    174 times
  • Short Desc
    The URL used in the URL Rewrite Rule throws a 500 error.
  • Details
    If the URL Is Not properly formatted, you may encounter a 500 error when creating the URL rewrite rule.

     

    500 - Internal server error.
    There is a problem with the resource you are looking for, and it cannot be displayed.
  • Recreate Issue
    The URL is not properly formatted for the Rewrite rule.


    <rule name="MyRule" stopProcessing="true">
    <match url="MyRule/([_0-9a-z-(-)-,-]+)/([_0-9a-z-(-)-,-.-]+)/([_0-9a-z-(-)-,-]+)" />
    <action type="Rewrite" url="default.asp?Type=Page&ID={R:1}&Name={R:2}&GID={R:3}" appendQueryString="true" />
    </rule>
  • Resolve Issue
    There has to be &amp; instead of the single & symbol.

    <rule name="MyRule" stopProcessing="true">
    <match url="MyRule/([_0-9a-z-(-)-,-]+)/([_0-9a-z-(-)-,-.-]+)/([_0-9a-z-(-)-,-]+)" />
    <action type="Rewrite" url="default.asp?Type=Page&ID={R:1}&Name={R:2}&GID={R:3}" appendQueryString="true" />
    </rule>