Q:

How to Properly set base_url() in codeigniter?

I am working on an application based on codeigniter, i have created a global layout page on that i page i have included all the css, js and other images that is in assets folder in codeigniter root.
i have included those files like below code
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/front/website/static/fonts/icomoon-greycom/css/style.css">

when i visit homepage https://mypage.com, it works fine
it loads those files as
https://mypage.com/assets/front/website/static/font/icomoon-greycom/css/style.css

but when i visit other links like.
https://mypage.com/region/india
den it load 
https://mypage.com/region/india/assets/front/wesbite/static/font/icon-greycom/css/style.css

but i want it should load only https://mypage.com/assets/assets/front/wesbite/static/font/icon-greycom/css/style.css
in my config.php page
$config['base_url'] = "https://www.mypage.com/";

how to solve this issue.

A:

Put the asset path inside the base_url function (as per the docs).
e.g. 
<?php echo base_url('assets/front/website/static/fonts/icomoon-greycom/css/style.css'); ?>

A:

Use this:
<link rel="stylesheet" href="<?php echo site_url(); ?>assets/front/website/static/fonts/icomoon-greycom/css/style.css">

