相关疑难解决方法(0)

如何删除codeigniter路径中的"index.php"

如何"index.php"在中心某处的codeigniter中删除每条路径中的延伸?我想要干净的非index.php-fied URLs

php mod-rewrite codeigniter url-rewriting

114
推荐指数
9
解决办法
12万
查看次数

CodeIgniter | .htaccess从url中删除index.php

好吧,我完全按照codeigniter文档中的要求,创建了新文件.htaccess

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
Run Code Online (Sandbox Code Playgroud)

我正在使用xampp,所以我访问该网站的网址是

http://localhost:12/projects/zorkif_nextgen/index.php/main
Run Code Online (Sandbox Code Playgroud)

现在应用上面的.htaccess文件后,我尝试了没有像这样的index.php

http://localhost:12/projects/zorkif_nextgen/main
Run Code Online (Sandbox Code Playgroud)

但它没有工作,而是将我重定向到这个网址

http://localhost:12/xampp
Run Code Online (Sandbox Code Playgroud)

如何解决这个问题?

加上我在尝试.htaccess后在我的页面上收到错误

在页面顶部的消息出现,

 Error Occured.
Warning!. Make sure you perform the correct action.
The Action has been completed Successfully. 
Run Code Online (Sandbox Code Playgroud)

编辑:

这是我的一些config.php文件设置

$config['base_url'] = '';
$config['index_page'] = 'index.php';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '';
$config['enable_hooks'] = FALSE;
$config['permitted_uri_chars'] = 'a-z 0-9~%.:_\-';
$config['allow_get_array']      = TRUE;
$config['enable_query_strings'] = FALSE;
$config['controller_trigger']   = 'c';
$config['function_trigger']     = 'm';
$config['directory_trigger']    = 'd'; // experimental not currently in use
$config['sess_cookie_name']     = 'zk_ci_session'; …
Run Code Online (Sandbox Code Playgroud)

php .htaccess routing codeigniter

7
推荐指数
2
解决办法
3万
查看次数