2

I want to load my home page(base_url) when I click on my logo.

Base url - (http://localhost:8888/adminpanel/)
When I use base_url() function inside the anchor tag like <a href="<?php echo base_url(); ?>" , It taking me to (http://localhost:8888/adminpanel/index.html).

Actually I couldn't find this index.html anywhere in my adminpanel folder.

So friends please help me to find a solution for this. Thanks in Advance. :)

Shihas
  • 814
  • 15
  • 44

3 Answers3

0

okay i got it can you please try with

<a class="navbar-brand" href="<?php echo base_url();?>blog"><img src="<?php echo base_url()?>assets/img/ro.jpg" class="img-responsive" alt="" title=""></a>

dont write your url inside the function just try with this

Tejas Mehta
  • 791
  • 1
  • 6
  • 15
0

If you want to go to your homepage the you can use <?php echo site_url()?> base_url in simple words used for getting base path necessary for css or images

if your hompage is http://www.example.com you can have <?php echo site_url()?>

and if you want to go to http://www.example.com/index.php/dashboard you can have <?php echo site_url('dashboard'); ?> where in config.php

$config['base_url'] = '';
$config['index_page'] = 'index.php';

give a try to the above things.

More description regarding site_url and base_url can be found here what is the difference between site_url() and base_url()?

Community
  • 1
  • 1
Vivek Shah
  • 434
  • 3
  • 10
0

In config.php set following:

$config['base_url'] = 'http://example.com/'; // Set your Home URL

If you are using mod_rewrite than change following..

$config['index_page'] = '';
Nikhil
  • 312
  • 2
  • 13