ColdFusion 2016: Do you have a folder in your web root named "api" or "rest"?

I just installed ColdFusion 2016 (updated from CF10) and I noticed that whenever I try to access a folder in my web route called api, I get an internal error of 500.

For example: www.mysite.com/api/

I assume this has something to do with the new REST ColdFusion API service, so I created another directory called "rest", performed the same test (www.mysite.com/rest/) and received another 500 errors.

See screenshot of IIS error: enter image description here

It is strange that I do not use the ColdFusion REST service, and I do not have it in the ColdFusion Administrator.

My question is:

Are you allowed to have folder names in the root folder with the name "api" or "rest"? Or is it now reserved folder names? Is there a way around this feature for a specific site so that I can use these folder names?

+6
source share
1 answer

Post this on the Adobe forums that should answer your question:

The reason you cannot access / api / or / rest / is because there is a cf servlet mapping for these folders.

You can remove the mapping by going to cfinstall / cfusion / wwwroot / WEB-INF / web.xml. Find api-servlet mapping and comment on this.

There seems to be no way to do this for a specific site other than using IIS rewriting to redirect traffic to another folder. Something like this should work (redirects traffic from / api / to / api 2 /):

<rule name="Redirect" stopProcessing="true"> <match url="^api$|^api/(.*)" /> <action type="Rewrite" url="api2/{R:1}" appendQueryString="true" /> </rule> 

if someone knows a way to disable it for a specific site without changing web.config, please feel free to share your ideas.

+11
source

All Articles