title: Codeigniter can't find relative paths to resources with htaccess
body: <p>I'm working with codeigniter and I'm stuck with the paths to css/js, removing the index.php and .htaccess. I'm trying to load my resources but I'm always getting errors in my </p>
  
  <p>I have the following structure in my htdocs folder</p>
  
  <pre><code>Course
  |
  | 
   Project
         | 
         |
          js
          css
          .htaccess
          application
                    |
                    |
                    view
                       |
                       |
                       templates
                               |
                               |
                               footer.php
  </code></pre>
  
  <p>In my <strong>footer.php</strong> I have </p>
  
  <pre><code>&lt;script type="text/javascript" src="../../../js/script.js"&gt;&lt;/script&gt;
  </code></pre>
  
  <p>The only thing that this script.js contains is a alert to should pop up on document.ready.</p>
  
  <p>In my <strong>config</strong> file I have set my <strong>base url</strong> to</p>
  
  <pre><code>$config['base_url'] = 'http://localhost/course/project/';
  </code></pre>
  
  <p>And in my <strong>.htaccess</strong> I have (With this I was able to remove the index.php from the url Now I surf to <code>http://localhost/course/project/profile</code> instead of <code>http://localhost/course/project/index.php/profile</code>) while this is not the correct way to do it like described on <a href="http://ellislab.com/codeigniter/user-guide/general/urls.html" rel="nofollow">codeigniter guide - removing the index.php</a></p>
  
  <pre><code>RewriteEngine on
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule .* index.php/$0 [PT,L] 
  IndexIgnore *
  </code></pre>
  
  <p>But this is giving me this error in console for loading my js resource</p>
  
  <pre><code>GET http://localhost/js/script.js 404 (Not Found) 
  </code></pre>
  
  <p>Before the code above, I had this in my .htaccess like described on their site</p>
  
  <pre><code>RewriteEngine on
  RewriteCond $1 !^(index\.php|images|css|js|robots\.txt)
  RewriteRule ^(.*)$ course/project/index.php/$1 [L]
  </code></pre>
  
  <p>But this is giving me </p>
  
  <pre><code>GET http://localhost/js/script.js 404 (Not Found) profile:80
  </code></pre>
  
  <p>and when surfing to <code>http://localhost/course/project/profile</code> I'm getting </p>
  
  <pre><code>Internal Server Error
  
  The server encountered an internal error or misconfiguration and was unable to complete your request.
  
  Please contact the server administrator at postmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.
  
  More information about this error may be available in the server error log.
  
  Additionally, a 500 Internal Server Error error was encountered while trying to use an ErrorDocument to handle the request.
  </code></pre>
  
  <p>I've spent hours tracking and changing url, paths, etc and I'm all confused about this now. I hope someone can help me with this?</p>