0

In constants.php I have

define('URL','localhost/indianeers/');
define('CSS',URL.'assets/css/');

and config.php I have

 $config['base_url']= URL;

and view page I attached

<link rel="stylesheet" href="<?php echo CSS.'developer.css' ;?>" />

But this page is not loaded it seems page not found. Can anyone help me please.

Jenz
  • 8,280
  • 7
  • 44
  • 77

3 Answers3

0

Change

$config['base_url']= URL;

to

$config['base_url']= "http://localhost/indianeers/"

and use base_url function, no need to use constant

<link rel="stylesheet" href="<?php echo base_url('assets/css/developer.css') ;?>" />

OR if you can load html helper then link_tag() function for load css

Girish
  • 11,907
  • 3
  • 34
  • 51
0

U can also use Base Tag in Html (View) Head

Create a folder named assets in root directory of your project and create css folder in it then Place you css there rootdir(project name)/assets/css/developer.css

<head>
    <base href="<?php echo base_url()?>" />
    <link rel="stylesheet" href="assets/css/developer.css" />
</head>
Manwal
  • 23,450
  • 12
  • 63
  • 93
0

If your file assets/css/developer.css is available and You can not access it directly via

http://localhost/indianeers/assets/css/develope.css

then the problem is with your .htaccess. Replace it with the following,

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

Hope this helps :)

Ijas Ameenudeen
  • 9,069
  • 3
  • 41
  • 54