-
Notifications
You must be signed in to change notification settings - Fork 117
URL Rewrite Rule Examples
This page gives example URL Rewriting rules for the most common Rewriting engines. All examples assume that your API exists at: http://example.com/api/index.cfm, and the resulting URL should resemble: http://example.com/api/artists (where "/artists" is the resource being requested)
See the official documentation for more information.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^/api/(.*) /api/index.cfm/$1Under ColdFusion 10 because of Tomcat, you need to use
RewriteCond %{REQUEST_FILENAME} !/webservices/rest-taffy/index.cfm
RewriteRule ^/webservices/rest-taffy/(.*) /webservices/rest-taffy/index.cfm?endpoint=/$1 [PT]
where /webservices/rest-taffy/ is the path from your web root to where ever you installed Taffy i.e. it should have a 'resources' subfolder.
See the official documentation for more information.
RewriteRule ^/api/(.*)$ /\api/index.cfm/$1Note: As far as I can tell, the backslash in the 2nd half of the rule ("\api") SHOULD NOT be necessary, but I've seen more than one report that someone's rule didn't work without it, but did after adding it. I don't understand why it's necessary, but I'm documenting it here for your benefit!
See the official documentation for more information.
?Be awesome: Contribute to the wiki and document what this syntax should be!
See the official documentation for more information.
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule>
<match url="^api/([.*])$" />
<action type="Rewrite" url="index.cfm/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>