简体   繁体   中英

How to resolve Access forbidden! error in codeigniter with xampp server

I am running a codeigniter project on xampp server it working fine with default controller but when I am trying to access other than default controller it is saying Access forbidden! You don't have permission to access the requested object. It is either read-protected or not readable by the server.

I have made changes in my config.php file as:

$config['base_url'] = 'http://localhost/passion';
$config['index_page'] = '';

& this is my .htaccess file looks like:

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

Thanks in adnvance.

Make sure .htaccess should be in folder passion

$config['base_url'] = 'http://localhost/passion/';
$config['index_page'] = '';

.htaccess file should be like:

RewriteEngine On

DirectoryIndex index.php
RewriteCond $1 !^(index\.php|resources|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]

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