繁体   English   中英

如何解决禁止访问! 与xampp服务器的codeigniter中的错误

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

我在xampp服务器上运行一个codeigniter项目它使用默认控制器工作正常,但当我尝试访问除默认控制器以外的其他人说它禁止访问! 您无权访问请求的对象。 它受读保护或服务器无法读取。

我在config.php文件中进行了以下更改:

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

这是我的.htaccess文件,如下所示:

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

谢谢你的支持。

确保.htaccess应该处于passion文件夹中

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

.htaccess文件应该是这样的:

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]

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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