css not showing with htaccess - 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: css not showing with htaccess (/showthread.php?tid=12137) |
css not showing with htaccess - El Forum - 10-07-2008 [eluser]frietkot[/eluser] Hi, I use a css file in my view file with this code Code: <?=link_tag('style.css');?> and it works perfect. But when i use my htaccess file Code: RewriteEngine on That works too but all my images and styles are not shown. What is wrong? css not showing with htaccess - El Forum - 10-07-2008 [eluser]mdowns[/eluser] Add the stylesheet or images folder to the RewriteCond line: Code: RewriteEngine on css not showing with htaccess - El Forum - 10-07-2008 [eluser]frietkot[/eluser] thanks but same thing. css not showing with htaccess - El Forum - 10-07-2008 [eluser]Nick Husher[/eluser] You also need to update your links, so your .htaccess should have in it Code: RewriteEngine on Your directory structure should look like this: Code: / Your CI code should look like this: Code: <?=link_tag('css/style.css') ?> And lastly, your CSS file should look like this: Code: .my-style .declaration { css not showing with htaccess - El Forum - 10-07-2008 [eluser]tsisson[/eluser] I like this snippet better. Much more flexible, isn't it? Code: RewriteEngine on css not showing with htaccess - El Forum - 10-08-2008 [eluser]frietkot[/eluser] Thanks TSisson, easy and practical solution. It works now |