convert web.config rewrite rule to htaccess rewrite rule (All files without an extension to be processed as .cfm) convert web.config rewrite rule to htaccess rewrite rule (All files without an extension to be processed as .cfm) apache apache

convert web.config rewrite rule to htaccess rewrite rule (All files without an extension to be processed as .cfm)


I don't really know about Tomcat; I assume you need Apache because Tomcat's no good for serving your non-script content.

You could set them up so that they both have the same document root, thus have congruent URLs, but have Tomcat listening on a different port, and not have that port open externally. Then you could proxy requests that are for (hidden) cfm files like so:

RewriteEngine onRewriteCond %{REQUEST_FILENAME}.cfm -fRewriteCond %{THE_REQUEST} ^\S++\s++([^?\s]++)(\?\S*)?RewriteRule ^ http://127.0.0.1:8080%1.cfm%2 [NS,NE,P]RewriteRule (?<=.cfm)$ http://127.0.0.1:8080/404.cfm [NS,NE,P]

The second rule is an example to pretend that the cfm files are not there if request directly.

You will need the appropriate proxy module(s) enabled.