CodeIgniter Forums
CSS, JS, Image and inner page links are not working - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Installation & Setup (https://forum.codeigniter.com/forumdisplay.php?fid=9)
+--- Thread: CSS, JS, Image and inner page links are not working (/showthread.php?tid=68310)



CSS, JS, Image and inner page links are not working - shehin - 06-22-2017

hello,

i have setup a new site is my server, all seems to be ok, but CSS, JS, Image and inner page links are not working. i did not add any code in .htaccess file yet. please advise how i can resolve this issue.


RE: CSS, JS, Image and inner page links are not working - Martin7483 - 06-22-2017

Add code to your htaccess file.

What code is in your htaccess file? And what do your links look like?


RE: CSS, JS, Image and inner page links are not working - Paradinight - 06-22-2017

(06-22-2017, 11:46 AM)Martin7483 Wrote: Add code to your htaccess file.

What code is in your htaccess file? And what do your links look like?

codeigniter will work without htaccess.

@shehin

add the base_url to config.php

and in the html head

Code:
<link rel="stylesheet" href="<?=base_url('path_to_css_file/youcssfile');?>">

if you have a folder strukture like this:

application
assets/css/youcssfile.css
system
index.php

you can do this:
Code:
<link rel="stylesheet" href="<?=base_url('assets/css/youcssfile.css');?>">



RE: CSS, JS, Image and inner page links are not working - Martin7483 - 06-22-2017

(06-22-2017, 11:52 AM)Paradinight Wrote:
(06-22-2017, 11:46 AM)Martin7483 Wrote: Add code to your htaccess file.

What code is in your htaccess file? And what do your links look like?

codeigniter will work without htaccess.

But only if

PHP Code:
$config['index_page'] = 'index.php'

is not blank. Or index.php will not be added to the generated urls


RE: CSS, JS, Image and inner page links are not working - Paradinight - 06-22-2017

(06-22-2017, 12:23 PM)Martin7483 Wrote:
(06-22-2017, 11:52 AM)Paradinight Wrote:
(06-22-2017, 11:46 AM)Martin7483 Wrote: Add code to your htaccess file.

What code is in your htaccess file? And what do your links look like?

codeigniter will work without htaccess.

But only if

PHP Code:
$config['index_page'] = 'index.php'

is not blank. Or index.php will not be added to the generated urls

True. But the index.php is the default value Big Grin

We need more information


RE: CSS, JS, Image and inner page links are not working - Martin7483 - 06-22-2017

(06-22-2017, 12:39 PM)Paradinight Wrote: True. But the index.php is the default value Big Grin

We need more information

Indeed, my glass ball is a bit fuzzy today Tongue