title: When using URL rewrite files are included multiple times?
body: <p>I am developing a new site in ColdFusion 10 and doing some url rewriting using the .htaccess file.  I have three rules that work very well when I call them without other includes. When I wrap them in includes, I get an error.</p>
  
  <p>Here are my rules:</p>
  
  <pre><code>RewriteEngine on
  RewriteRule ^advertise$ /index.cfm?Section=Advertise
  RewriteRule ^bike/([0-9]+)/([0-9]+)/ /index.cfm?Section=Bike&amp;BikeID=$1&amp;FeatureID=$2
  RewriteRule ^bike/([0-9]+)/ /index.cfm?Section=Bike&amp;BikeID=$1
  </code></pre>
  
  <p>The index page figures our which section to show and calls includes the appropriate file wrapped around a header and footer, like this:</p>
  
  <pre><code>include "header.cfm"; 
  include "#VARIABLES.Section#.cfm";
  include "footer.cfm";
  </code></pre>
  
  <p>The problem is, it doesn't quite work for the "Bike" pages, the second two rules.  It appears that the header file is included several times, which makes the links to the CSS and other files bad, which messes up the page.  If I comment out the header and footer includes, everything works just fine, but there's no header or footer, which is not what I want.</p>
  
  <pre><code>// include "header.cfm"; 
  include "#VARIABLES.Section#.cfm";
  // include "footer.cfm";
  </code></pre>
  
  <p>Is there something in the url rewrite  rules that causes the bike pages to be loaded several times and then fail?</p>
  
  <pre><code>http://flyingpiston2012-com.securec37.ezhostingserver.com/
  </code></pre>
  
  <p>You can try the page here and see the problem by clicking the links.  Any ideas on how to fix this?</p>
  
  <p>UPDATE</p>
  
  <p>When I make all of my links absolute by including the entire URL, the problem goes away.</p>
  
  <pre><code>&lt;cfoutput&gt;
  &lt;link href="#APP.Home#/bootstrap/css/bootstrap.css" rel="stylesheet"&gt;
  &lt;/cfoutput&gt;
  </code></pre>
  
  <p>Still, I should NOT have to include an absolute path to files. Any hints as to why this isn't working for me?</p>
  
  <p>UPDATE</p>
  
  <pre><code>// THIS FIXES THE PROBLEM
  &lt;base href="#APP.Home#/"&gt;
  &lt;link href="/bootstrap/css/bootstrap.css" rel="stylesheet"&gt;
  
  // THIS FIXES THE PROBLEM
  &lt;link href="#APP.Home#/bootstrap/css/bootstrap.css" rel="stylesheet"&gt;
  
  // THIS IS THE PROBLEM
  &lt;link href="/bootstrap/css/bootstrap.css" rel="stylesheet"&gt;
  </code></pre>