i tried to find some answers but it doesnt work for me so i decided to ask here:
im new to codeigniter, after watching some few tutorials i end up with this .htaccess code.
RewriteEngine On
RewriteBase /myprojectname
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index.php|css|robots.txt)
RewriteRule ^(.*)$ index.php/$1 [L]
ErrorDocument 404 /index.php
im using xampp on localhost, my problem is that i cant load my css in my view
when in fact i include css in RewriteCond $1 !^(index.php|css|robots.txt)
root looks like this
/
-application
-css
-js
-font
-system
-.htaccess
-index.php
解决方案
You don't have to include css and robots.txt in that line because RewriteCond %{REQUEST_FILENAME} !-f takes care of it (basically it says Rewrite if it is NOT a file - '!-f' part), actually you can delete RewriteCond $1 !^(index.php|css|robots.txt). If then your css still doesn't work, use <?php echo base_url();?>css/metro-bootstrap.css this line of code, base_url() indicates base path in your project.