I’ve used routing in Codeigniter to get nice clean URLs to my pages. I also have modified the htaccess file to remove the index.php from the URL.
It’s all working great except for 1 issue – When I go to a URL it won’t load the CSS or Images unless the trailing / is added to the URL.
For example:
mysite.com/blah
Does NOT work
mysite.com/blah/
DOES work
Probaby something in the .htaccess file? Here is my file:
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|user_photos|favicon|robots\.txt)
RewriteRule ^(.*)$ /subdirectory/index.php/$1 [L]
Any ideas? Natrually I want users to be able to access the page even if they don’t add the trailing /
Use
<?php echo base_url();?>in front of your css URLexample:
As for the .htaccess