-1

I have an application with codeigniter, I want to call a Home controller when the application view is in the Contacts menu, but an error appears like this

enter image description here

Link URL

<li><a href="<?= base_url('home');?>" class="active">Beranda</a></li>

.htaccess

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
labkes
  • 9
  • 3

1 Answers1

0

Make .htaccess file in your root directory using below code

RewriteEngine on
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
Jake G
  • 55
  • 5
  • tried it, still the same – labkes Jul 31 '23 at 07:38
  • I think your application/config.php file has a problem. $config['base_url'] = 'http://'.$_SERVER['SERVER_NAME'].'/Your Ci folder_name'; – Jake G Jul 31 '23 at 08:53
  • "tried it, still the same" - Because, basically, it is the same! (This is not a `.htaccess` issue.) @labkes – MrWhite Jul 31 '23 at 09:38
  • this is the common mistake, you may check first the path or see this reference https://stackoverflow.com/questions/18902887/how-to-configuring-a-xampp-web-server-for-different-root-directory – Jake G Jul 31 '23 at 09:50