简体   繁体   中英

Page not found error when trying to access index controller in Codeigniter

In my codeigniter project, I am removing index.php extension from the URLs using htaccess file. But this is giving me

404 (Page Not Found) Error

when trying to access pages/functions in Index controller. I tried to load a page, http://site.org/projectname/index/language/french which gave me this error.

My htaccess code :

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

Can anyone help me to resolve this? Thanks in advance.

Try like this

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^(.*)$ index.php/$1 [L]

You have to remove / before index.php

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM