Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue with css/image/js files in codeigniter base directory
    primarykey
    data
    text
    <p>I've been stumbling around setting up the .htaccess file to redirect all requests to the index.php file under xampp in windows 7(removing index.php from the url), and think I may have created an issue for myself...but then again it may be unrelated.</p> <p>I seem to be having an issue referencing the directories I have setup in the base directory for css, images, and js. I have tracked the issue down, but not sure how to resolve it just yet. If I navigate back a directory ../css/stye.css vs. css/style.css then the stylesheet will load. If I type in the base url or base url with index function call, everything loads as expected:</p> <pre><code>http://localhost/site http://localhost/site/home </code></pre> <p>Now when I add the controller method name</p> <pre><code>http://localhost/site/home/index </code></pre> <p>my css is no longer included (until I go into firebug and navigate back a directory)</p> <p>The code in my .htaccess file (that I found to work with xampp) located in my base directory is as follows:</p> <pre><code>RewriteEngine on RewriteCond $1 !^(index\.php|resources|robots\.txt) RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L,QSA] </code></pre> <p>I openly admit to not not knowing as much as I probably should about .htaccess files.</p> <p>CSS href:</p> <pre><code>&lt;link rel="stylesheet" type="text/css" href="css/jmw.css" /&gt; </code></pre> <p><strong>EDIT</strong></p> <p>.htaccess file edited as suggested by Rajeev Ranjan</p> <pre><code>RewriteEngine on RewriteCond $1 !^(index\.php|robots\.txt|css|images|js) RewriteRule ^(.*)$ ./index.php/$1 [L] </code></pre> <p>I am operating off of the assumption that every view is working as if it where the index.php file itself and accessing directories in this manner. Everything works when using the base_url() function in front of the stylesheet, javascript, or image calls, but I am attempting not to rely on base_url() function in multiple locations of the view file.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload