So today I started using code-igniter and I have come across a problem. The problem is that I want to link a css file to my default view. My attempt was to put my css file in the root in root. So it looks like this
-Root
--application
--system
--styles
----main.css
--index.php
Then in my view I link my css file by pretending it was in the same folder like this:
<link href="styles/main.css" rel="stylesheet" type="text/css">
Now when I access my default controler like this: http://localhost/index.php
it works!!
But when I access it like this http://localhost/index.php/home/index
it doesn't work. it tries to access the css file using this path http://localhost/index.php/styles/main.css
How do i fix this or moreover, what is the right way to do this?