Reputation: 139
I hope everyone will be doing good. I am stuck in a serious issue since morning that all the links in my CodeIgniter project have stopped working. Till last night it was working fine. But now it's not working. Url Helper is imported. Any sort of help would be appreciated.
<h1 id="fh5co-logo"><a href="<?php echo base_url('template'); ?>">Hotels Social Portal</a></h1>
<nav id="fh5co-menu-wrap" role="navigation">
<ul class="sf-menu" id="fh5co-primary-menu">
<li><a class="" href="<?php echo base_url('template'); ?>">Home</a></li>
<li>
<a href="<?php echo base_url('hotels'); ?>" class="">Hotel<i class="fa fa-angle-double-down"></i></a>
Upvotes: 2
Views: 924
Reputation: 1680
Set base url in config.php
$config['base_url'] = (isset($_SERVER['HTTPS']) ? "https://" : "http://") . $_SERVER['HTTP_HOST'] . preg_replace('@/+$@', '', dirname($_SERVER['SCRIPT_NAME'])) . '/';
Upvotes: 1
Reputation: 503
Set your base url in config/config.php file. as follow.
$config['base_url'] = 'http://localhost/projectname';
Upvotes: 3