Welcome Guest, Not a member yet? Register   Sign In
Images not displayed - htaccess problem?
#1

[eluser]jakeone[/eluser]
Hi,

My site seems to be working in all respects except images aren't loading.

I am using a "view template" to call other views:

class myController extends Controller {
function index(){
$this->load->view('templateMain');
}}

and templateMain.php contains:

<?php $this->load->view('header'); ?>
<?php $this->load->view($main); ?>
<?php $this->load->view('footer'); ?>

and header.php sets the path to my CSS file:

<link href="<?= base_url(); ?>/css/style.css" rel="stylesheet" type="text/css" />
[removed][removed]

As a test, I hardcoded an image into one of my views but when I tested it, the image wasn't there - and the strangest part is that even the HTML <img > was missing...

I suspect it is something to do with the routing. I don't know much about creating an htaccess file so I copied one from the Internet :$

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

which I stored under the "system" folder

My setup is as follows:

css
images
js
system
- application
- models
- views
- controllers

base_url is http://localhost/myapp/




Theme © iAndrew 2016 - Forum software by © MyBB