[eluser]Higher Logic[/eluser]
This line of code:
Code:
RewriteCond $1 !^(index\.php|images|css|javascript|rte|robots\.txt)
This items separated by a pipe are files and/or directories that you don't want CI's index.php file to handle. That would be everything in the images, css, javascript, and rte directories, and the robots.txt file.
So unless you have those directories, you don't need to list them. Something like this would be better:
Code:
RewriteCond $1 !(.jpg|.gif|.png|.swf|.css|.js|.txt)$
(I believe that is right, you don't want it to handle files that end in those extensions)
[quote author="ufasoli" date="1188756624"]however now I can't get the neither the CSS or the JavaScript files(I'm using the ajax for CodeIgniter library as well) to load correctly when Using the Firefox - firebug addon I check the location where the style-sheets are supposed to be retrieved from, and it's very weird because I don't have any problems with the "index()" function the css and JavaScript are retreived from
www-root/myapp/styles
www-root/myapp/javascript
but when I try to move to a different function (contact in my case) the application tries to recover the files from
www-root/myapp/controller name/styles[/quote]
Try using your absolute path instead of the relative one:
Code:
<link rel="stylesheet" type="text/css" href="/styles/accueil.css" />
Notice the forward slash immediately before the directory? That means it should look for a styles directory starting from the public root of your site (e.g. domain.com). If your CSS stylesheet and JavaScript files are setup like you mentioned above, then you need to do this:
Code:
<link rel="stylesheet" type="text/css" href="/myapp/styles/accueil.css" />
...or this for JS:
The reason it works when you're on the index page is because the way you have the path setup, it is looking for a sub-directory from the root, and the myapp directory just happens to be there. If you're in a sub-directory though, it's trying to find another sub-directory called myapp that does not exist.