codeigniter 3删除的index.php问题问题、codeigniter、index、php

2023-09-02 00:33:15 作者:离不开XX

我有我开发用于codeigniter 2.1.4客户端的小项目,现在,他坚持要迁移到codeigniter 3 DEV版本。我知道这不是一个很好的IDEEA,但... 我的问题是,我不能删除URL中的index.php。

I have a little project that i developed for a client in codeigniter 2.1.4 and now, he insists to migrate to codeigniter 3 DEV version. I know that's not a good ideea but... My problem is that i can't remove the index.php from the url.

这是我的.htaccess文件:

This is my .htaccess file :

  Options +FollowSymLinks
  RewriteEngine on

  # Send request via index.php
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?/$1 [L]

我已删除的config.php文件中的index.php 没有运气 我重新安装了LAMP服务器(我在Ubuntu 12.04),重新配置我有其他的项目我的codeigniter 2.1.4和Laravel 4开发的本地服务器上,他们工作得很好,但这其中就杀了我。 谢谢!

I have removed the index.php from the config.php file No luck I reinstalled the LAMP server (i'm on Ubuntu 12.04'), reconfigured I have other projects on my local server developed on Codeigniter 2.1.4 and Laravel 4 and they work just fine but this one it's killing me. Thank you!

推荐答案

请直接添加跌破codeS到的的.htaccess 的文件,包括到您的 / codeigniter_project_folder /.htacess

Kindly add the below codes to .htaccess file and include it directly to your /codeigniter_project_folder/.htacess


    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php/$0 [PT,L]