Welcome Guest, Not a member yet? Register   Sign In
templete _ image not linked
#1

[eluser]learnq[/eluser]
Hi,
I have put my templete in view . Its a basic templete , I did not saparate header,footer,content etc.just rename the index.html to templete.php file.
and load from controller as

Code:
class Frontpage extends Controller {  
    
function __construct()
       {
            parent::Controller();
       }
    
    function index()
    {

      $this->load->view('template');
    }


}

It loads but it cannot link the .css and image files . The .css and image files are in the
view directory . I can statically link them but I dont thing it is good for future development. When I check the image link it says like
http://127.0.0.1/mysite/images/img.jpg.
The image files are in
system\application\views\images

My .htaccess file is like(found it in this forum)
Code:
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

Hope it is clear . Please help.
Thanks.
#2

[eluser]Michael Wales[/eluser]
It's because you are linking to /images/img.jpg when actually the image is found at /system/application/views/images/img.jpg (depending on what you have set as your webroot) - I assume the webroot is one level above /system/
#3

[eluser]learnq[/eluser]
Yes, that is what I mentioned. Than how to solve this issue so that when I upload this
file it works in the site without changing the image links?




Theme © iAndrew 2016 - Forum software by © MyBB