您好,我是codeigniter的新手。
当我访问网址名称"http://abc/php/newseller/home/sign"
时,它会给出404错误。但是当我访问http://abc/php/newseller/index.php/home/sign
时,它会给出页面。我想删除“index.php”,我的网站应该使用此网址运行"http://localhost/php/newseller/home/sign"
为此我试过.htaccess文件
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$0 [PT,L]
并删除application / config / config.php
中的index.php$config['index_page'] = '';
但得到404的相同问题
答案 0 :(得分:0)
您可以尝试在config.php中更改此方法
$config['uri_protocol'] = 'AUTO';
答案 1 :(得分:0)
更改config.php文件中的设置
$config['index_page'] = 'index.php';
$config['index_page'] = '';
请删除index.php文件并设置基本URL,它将正常工作。
请尝试使用此htaccess代码。
RewriteEngine On
RewriteBase /Project Folder Name
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|scripts|styles|vendor|robots\.txt)
#RewriteRule ^(.*)$ index.php/$1 [L]
RewriteRule ^(.*)$ index.php?/$1 [L,QSA]