如何从codeigniter URL中删除index.php [英] how to remove index.php from codeigniter URL

查看:60
本文介绍了如何从codeigniter URL中删除index.php的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


可能重复:

如何从codeigniter的URL中删除index.php?

我想从codeigniter网址中删除index.php。我已经创建了.htaccess文件,并在其上放置了以下代码(如在CodeIgniter网站上找到的。但是我无法在localhost上访问任何内容。如果将代码放置在.htaccess文件中,则会收到错误未找到。

I want to remove index.php from the codeigniter url. I have created .htaccess file and placed the following code on it (as found on the CodeIgniter website. But i can not access anything on the localhost. I get the error "Not Found", if i place the code in the .htaccessfile.

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

我的网址看起来像 localhost / test / project / index.php

推荐答案

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)$ index.php

这篇关于如何从codeigniter URL中删除index.php的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆