Can't link to css file if remove index.php using .htaccess file - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21) +--- Thread: Can't link to css file if remove index.php using .htaccess file (/showthread.php?tid=44430) |
Can't link to css file if remove index.php using .htaccess file - El Forum - 08-14-2011 [eluser]ammtar[/eluser] I have test site and it use css file Code: <link rel='stylesheet' type='text/css' media='screen' href='<?=base_url()?>/includes/css/style.css' /> But when I create .htaccess file to remove index.php in URL, the css is broken. Even if I use Code: <link rel='stylesheet' type='text/css' media='screen' href='http://mysite.co/includes/css/style.css' /> ?!?!?!? Can't link to css file if remove index.php using .htaccess file - El Forum - 08-14-2011 [eluser]ammtar[/eluser] SOLVED Code: RewriteEngine on I had to add "includes" and "css" (directories) Can't link to css file if remove index.php using .htaccess file - El Forum - 08-15-2011 [eluser]fesweb[/eluser] You are going to have a lot more problems if you don't change it to something more like this: Code: RewriteEngine On EDIT: IN other words, you would have to alter your htaccess every time you want to add a directory to your server. |