2
votes

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 ?

2
Its with this RewriteBase / - Abdulla Nilam
you need to remove index.php ? - Abdulla Nilam

2 Answers

7
votes

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]
2
votes
RewriteEngine on
# If the request is not for a valid directory
RewriteCond %{REQUEST_FILENAME} !-d
# If the request is not for a valid file
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond $1 !^(index\.php)
RewriteRule ^(.*)$ index.php/$1 [L]

try this