Search code examples
php.htaccesscodeigniter

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 ?


Solution

  • 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]