![]() |
Removing index.php From Pre-Built Site - 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: Removing index.php From Pre-Built Site (/showthread.php?tid=37442) |
Removing index.php From Pre-Built Site - El Forum - 01-10-2011 [eluser]Unknown[/eluser] Hi There, Totally new to CodeIgniter but been using EE for a while now so I'm not completely in the dark. I was kind of handed this pre-built CodeIgniter site to revise and launch, and I'm having some trouble with the URLs. The links are set to go to pages without index.php. "No problem" I think, I'll just upload the standard "negative" method .htaccess file and we'll be all set. Well doing that completely removed all styles and images from the site. What else should I try to get these index.php-less URLs working? Another type of .htaccess file? I'd rather not add index.php to the links if I don't have to... Thanks! Removing index.php From Pre-Built Site - El Forum - 01-10-2011 [eluser]sean_THR[/eluser] When referencing your assets such as images, stylesheets, JS, etc, you may need to give an absolute URL to them rather than relative. For example, on most of my sites, I use something similar to this: Code: <?=base_url();?>/assets/cs/style.css Removing index.php From Pre-Built Site - El Forum - 01-10-2011 [eluser]veritascs[/eluser] Also make sure in your htaccess file you have the condition to allow access to your assets (ie images/js/css/etc). This what I use: Code: #remove index.php from URL Removing index.php From Pre-Built Site - El Forum - 01-10-2011 [eluser]Unknown[/eluser] Worked like a charm! Thanks veritascs! |