0

Hi i am new to codeigniter. I tried to do the basic things but i'm getting errors. I'm using v.2.12. I want to do two things. 1. Remove index.php 2. Add external style sheet to my views.

I found lot of tutorial but no one is working for me. If index.php is removed then css not working. So can any one assist me how to do this?

I'm trying to do this basic things from the morning.

So please help me.

Thanks for reading my post

1
  • Post your codes. I.e. Rewrite rules and how you including your css. Commented Aug 6, 2012 at 9:40

1 Answer 1

1

well, your config page

$config['base_url'] = 'http://localhost/t/';
$config['index_page'] = '';

your .htaccess in root folder should contain following. Make sure to change path in RewriteBase to your path.

RewriteEngine on
RewriteBase /t/
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

And in your views

<link href="<?php echo $this->config->base_url();?>css/layout.css" rel="stylesheet" type="text/css" />

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.