0

I'm a codeigniter beginner and trying to link template with it. I haven't touched anything in config yet ( Except base_url() ), whenever I visit the home page that is http://localhost:1234/ci/ everything loads correctly but when I load another controller with url: http://localhost:1234/ci/index.php/register then I see the web page with broken css.

However localhost:1234/ci/index.php?/register loads correctly. Thanks in advance :)

  • `localhost` url's can-not work here. They can not even work on the person sitting next to you.. – Rohit416 Nov 07 '15 at 17:48
  • Besides no one here has a crystal ball to look inside your localhost so you may please update your question with some relevant code snippet if possible. – Rohit416 Nov 07 '15 at 17:50
  • if it loads with ? then its .htaccess problem ,usually we "hide" index.php see http://stackoverflow.com/questions/14783666/codeigniter-htaccess-and-url-rewrite-issues – Nassim Nov 07 '15 at 18:00
  • @Rohit - Yes I know that localhost doesn't work for anyone, was just trying my luck if someone faced something similar to my problem. – Sahil Sharma Nov 07 '15 at 18:02
  • @Nassim- Thank you for your help, it's really appreciated. – Sahil Sharma Nov 07 '15 at 18:05
  • It could be possible you are using relative links for CSS file. Try with absolute link and check if working i.e. `` pressuming you have directory `assets/css` in root. – Tpojka Nov 07 '15 at 18:15
  • @Tpojka - I did use the exact absolute link like yours but unfortunately the codeigniter script was re-generating the link to http://localhost:1234/ci/index.php/assets/css/style.css. Anyway, thanks for your help, I've got it solved by hiding the index.php from url – Sahil Sharma Nov 07 '15 at 18:39
  • On the your register controller do you have a header view and footer view. Also it could be because of your htaccess on main directory if you have any. Do not touch the htaccess in the application folder. –  Nov 08 '15 at 00:35
  • @wolfgang1983 - You got it right. I had header and footer view included in register.php view file also at first I did make the changes to htaccess in application folder. – Sahil Sharma Nov 08 '15 at 06:19

0 Answers0