0

Here is the code please check what's wrong i did

$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/e-biotech/';
@define(SITEURL,$config['base_url']);
4
  • what is issue your facing? Commented Nov 14, 2019 at 9:31
  • constants.php will load before config.php, so you cant use config file variable inside constant file, you can create constant of base url and use in config file. Commented Nov 14, 2019 at 9:33
  • trying to link css file in header like localhost/e-biotech/css/style.css Commented Nov 14, 2019 at 9:34
  • the code is still in config.php not in constants.php Commented Nov 14, 2019 at 9:36

1 Answer 1

0

Just remove @define(SITEURL,$config['base_url']);

Config.php

$config['base_url'] = 'http://'.$_SERVER['HTTP_HOST'].'/e-biotech/';

Now in your view file

you can sue site_url() as below

<head>
        <base href="<?= site_url() ?>">

And your assets will load perfectly

Sign up to request clarification or add additional context in comments.

3 Comments

i am using like this on header <base href="<?= site_url() ?>">
going to remove @define(SITEURL,$config['base_url']); then let's see
okay, tell me if any issue or not getting assets.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.