从codeIgniter路径删除index.php

编程入门 行业动态 更新时间:2024-10-21 19:37:50
本文介绍了从codeIgniter路径删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我在从CodeIgniter的网址中移除index.php时遇到问题。

I have a problem with removing the "index.php" from my URL in CodeIgniter.

尝试将我的.htaccess文件更改为:

I tried as to change my .htaccess file to :

RewriteEngine On RewriteCond $1 !^(index\.php|(.*)\.swf|robots\.txt) RewriteRule ^(.*)$ index.php/$1 [L]

我也尝试将 $ config ['index_page'] 更改为 code>并将 $ config ['uri_protocol'] 更改为'REQUEST_URI',但不会工作。

I also tried to change $config['index_page'] to '' and to change $config['uri_protocol'] to 'REQUEST_URI' but it won't work.

我也添加了这些行到 etc / apache2 / apache2.conf :

Options Indexes FollowSymLinks MultiViews AllowOverride all Order allow,deny allow from all

bu它也无效。

推荐答案

尝试这个:

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

您可以在这里找到其他解决方案:如何删除index.php在codeigniter的路径

You'll find other solutions here: How to remove "index.php" in codeigniter's path

更多推荐

从codeIgniter路径删除index.php

本文发布于:2023-10-31 18:54:30,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1546977.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:路径   codeIgniter   php   index

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!