Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I just installed ColdFusion 2016 (upgraded from CF10) and I noticed that whenever I try and access a folder in my webroot called 'api', I get an internal 500 error.

For example: www.mysite.com/api/

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

See the IIS error screenshot: enter image description here

The strange thing is that I don't use the ColdFusion REST service and I don't have it enabled in ColdFusion Administrator.

My Question:

Are you allowed to have folder names in your web root named "api" or "rest" anymore? Or are these now reserved folder names? Is there a workaround to disable this feature for a specific site so I can use these folder names?

like image 304
Dave L Avatar asked Oct 06 '16 18:10

Dave L


People also ask

How do I start an admin in ColdFusion?

Once you have installed ColdFusion, you can access the ColdFusion Administrator via the following URL: http://{website url}/cfide/administrator (where {website url} is the name of your website's URL). This is the default URL - this directory and it's contents is automatically created when you install ColdFusion.


1 Answers

Saw this on the Adobe Forums which should answer your question:

The reason you can't access /api/ or /rest/ is because there is a cf servlet-mapping for those folders.

You can remove the mapping by going to cfinstall/cfusion/wwwroot/WEB-INF/web.xml. Search for the api servlet-mapping and comment it out.

There doesn't seem to be a way to do this for a specific site other than using IIS rewrite to redirect traffic to another folder. Something like this should work (redirects traffic from /api/ to /api2/):

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

if anyone knows a way to disable this for a specific site without modifying web.config please feel free to share your ideas.

like image 196
Hen Avatar answered Oct 16 '22 10:10

Hen