Codeigniter - cannot load files in production server

1k views Asked by At

I have problem that cannot load any css, js, images, etc in production server.

Error resource: the server responded with a status of 404 (Not Found)

This is the my folder tree

public_html/
    application/
    assets/
    ...

I'm using base_url() when try to load any file in assets directory,

example: <link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/css/bootstrap.css"); ?>" />

I have no idea why i can't load such as those files. Can anyone please help me with this issue?

.htaccess file

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

There are 3 answers

0
Rishi Shrivastava On BEST ANSWER
Options Indexes FollowSymLinks
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Please use this .htacess

1
Noobie On

did u edit the application/config/config.php base_url?
or

i used it like this

<link rel="stylesheet" type="text/css" href="<?php echo base_url();?>assets/css/bootstrap.css" />

or i used it the wrong way?

0
pravin shinde On

have you checked the file rights on server ?? It should be executable xrw