Skip to main content
2Charlie
Inspiring
March 10, 2016
Answered

Could ColdFusion have caused the URLRewrite to not function properly?

  • March 10, 2016
  • 1 reply
  • 406 views

I'm using ColdFusion 10 with Paperthin's CommonSpot CMS. The hyperlink in each of the search result page is https://devbox.mysite.com/kb/article/?title=test-article and the URLRewrite should show https://devbox.mysite.com/kb/article/test-article on the client's browser instead. Below is the URL Rewrite.

<rule name="KB-rewrite" enabled="true">

    <match url="^kb/article/([a-zA-Z0-9\-]+)$" />

    <conditions logicalGrouping="MatchAll" trackAllCaptures="false">

    <add input="{QUERY_STRING}" pattern="1" negate="true" />

    </conditions>

    <action type="Rewrite" url="kb/article/?title={R:1}" appendQueryString="false" />

</rule>

I know that the URL Rewrite rule works because if I removed the "?title-" from the URL, it loads the article fine. The question is, why is it showing ?titlte= in the URL when without it, it would still works? What could have caused this behavior? Where can I start troubleshooting? Can it be my app's logic that uses ColdFusion that cause the problem? Suggestions are much appreciated.

    This topic has been closed for replies.
    Correct answer 2Charlie

    Okay, I was quite dumb on this one.  IIS URLRewrite works as it supposed to since if I removed the ?title=, the page still loads. The problem was, in the search result hyperlink, I put ?ititle= as part of the URL so when a user clicked on the result, it would show the URL as containing the ?title= in it. Since the URLRewrite is working as it should, all I had to do was remove the ?title= from each result's hyperlink and my problem is resolved.

    1 reply

    2Charlie
    2CharlieAuthorCorrect answer
    Inspiring
    March 10, 2016

    Okay, I was quite dumb on this one.  IIS URLRewrite works as it supposed to since if I removed the ?title=, the page still loads. The problem was, in the search result hyperlink, I put ?ititle= as part of the URL so when a user clicked on the result, it would show the URL as containing the ?title= in it. Since the URLRewrite is working as it should, all I had to do was remove the ?title= from each result's hyperlink and my problem is resolved.