Skip to content

SES URL Rewrite Config

cfchris edited this page Apr 24, 2013 · 2 revisions

You probably don't want your API URLs to contain "index.cfm" (e.g. /api/index.cfm/product/1). To get a cleaner URL (e.g. /api/product/1), you will need a URL rewrite.

IIS URL Rewrite

Here is what you really need.

find: (^api/)(?!index\.cfm)(.*)
rewrite: api/index.cfm/{R:2}

Here are some detailed instructions for adding a rule to IIS.

  1. Install URL Rewrite.
  2. Open "Internet Information Services (IIS) Manager".
  3. Select the site your API folder is hosted under.
  4. Double-click the "URL Rewrite" icon.
  5. Click "Add Rule(s)..." in the upper right.
  6. Select "Inbound rules > Blank rule" and hit "OK".
  7. Enter something like "API (add index.cfm)" for the "Name".
  8. Enter "(^api/)(?!index.cfm)(.*)" for the "Pattern".
  9. Enter "api/index.cfm/{R:2}" for the "Rewrite URL".
  10. (Optional) You should probably check "Stop processing of subsequent rules".
  11. Click "Apply" in the upper right.

You should not need the "/index.cfm" in your URLs anymore.

Clone this wiki locally