从代码点火器中删除index.php

从代码点火器中删除index.php,php,.htaccess,codeigniter,mod-rewrite,Php,.htaccess,Codeigniter,Mod Rewrite,我已经搜索了我的问题,但还没有看到一个与我类似的问题 我在我的服务器上安装了一个新的CI,出于安全原因,我将“应用程序”和“系统”文件夹移到了public_html之外的一个名为“应用程序”的文件夹中。我尝试了很多论坛使用的方法,但似乎没有一种有用 下面是我的文件夹结构,想知道为.htaccess键入什么,以及该.htaccess指向哪里 / app (system and application folder for CI resides here) public_html (index.ph

我已经搜索了我的问题,但还没有看到一个与我类似的问题

我在我的服务器上安装了一个新的CI,出于安全原因,我将“应用程序”和“系统”文件夹移到了public_html之外的一个名为“应用程序”的文件夹中。我尝试了很多论坛使用的方法,但似乎没有一种有用

下面是我的文件夹结构,想知道为.htaccess键入什么,以及该.htaccess指向哪里

/
app (system and application folder for CI resides here)
public_html (index.php - the one which defines ENVIRONMENT, styles, other htmls and my current .htaccess resides here)
我当前的.htaccess如下所示:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* index.php/$1 [PT,L]
请帮忙!谢谢你抽出时间

编辑 目前我的url是这样的 xxx.xxx.xxx.xxx/~app/index.php/user/check/id (它位于共享主机上,但尚未链接到域,因此url中的ip地址和分区。)

我想达到这样的目标 xxx.xxx.xxx.xxx/~app/user/check/id
当我连接我的域名时,它应该会起作用。(例如www.mydomain.com/user/check/id)

好的,我想我已经解决了这个问题

这很可能与我拥有的“唯一”url有关。我想如果它是一个普通的域名,就不会有那么多问题

我的url>xxx.xxx.xxx.xxx/~app/index.php/user/check/id

我的目录结构保持不变>

/应用程序(应用程序和系统目录位于此处)

/public_html(index.php和.htaccess位于此处)

.htaccess代码如下:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /~app/                        << NOTE the addition
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

就这些

您不想删除
index.php
,是吗?我想,我会在问题中添加更多信息。
$config['base_url'] = 'http://xxx.xxx.xxx.xxx/~app/';
$config['index_page'] = '';