Welcome Guest, Not a member yet? Register   Sign In
link external style sheet to view
#1

[eluser]runrun[/eluser]
Hi,

I am new

I trying to create page with css. In the view file, in the header I put

Code:
<link rel="stylesheet" href="css/main_css.css" type="text/css"/>

I also tried this

Code:
<link rel="stylesheet" href="<?=base_url()?>css/main_css.css" type="text/css"/>

both not working. How do you guy do it ?
#2

[eluser]TheFuzzy0ne[/eluser]
Welcome to the CodeIgniter community!

Do you have an .htaccess file in the root of your Web directory? If so, please paste the contents in here.
#3

[eluser]runrun[/eluser]
Here we are,
Code:
RewriteEngine on
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ /index.php/$1 [L]
#4

[eluser]TheFuzzy0ne[/eluser]
Your problem is that everything is being redirected through index.php. Please see [url="http://codeigniter.com/wiki/mod_rewrite/"]this wiki page on mod_rewrite[/url]. If you have any problems, please let us know.
#5

[eluser]Jose DueƱas[/eluser]
You should add this to your htaccess file:

RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php?/$1 [L]

This allows to load files inside your css and images folder and the robots.txt too.
#6

[eluser]runrun[/eluser]
@Lab Technician: thank you for the welcoming solution. Its working.

@summer Student: Before going to the forum, I found article teaches that, I also put it in the htaccess but somehow not work for me.




Theme © iAndrew 2016 - Forum software by © MyBB