Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

all links redirects to localhost/dashboard/ with codeigniter

I am very much new to codeigniter. I have a codeigniter project and i need to do some changes.I have pasted it into htdocs and changed application/config/config.php 's base_url to localhost's path.

and changed database connection inside application/config/database.php

after above changes , my index page is opening well on localhost.But all the links from index page redirects to http://localhost/dashboard/ .

I did not changed .htaccess file content. here it is :

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]

How to solve this ?

like image 776
Nirali Joshi Avatar asked Jun 02 '26 22:06

Nirali Joshi


1 Answers

if you need to remove index.php then use this

RewriteEngine on

RewriteCond $1 !^(index\.php|assets|image|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
like image 126
Abdulla Nilam Avatar answered Jun 04 '26 10:06

Abdulla Nilam



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!