删除windows 10上localhost中部署的codeigniter中的index.php

删除windows 10上localhost中部署的codeigniter中的index.php,php,apache,.htaccess,codeigniter,Php,Apache,.htaccess,Codeigniter,这是我的.htaccess文件。我的xampp安装位于我的E驱动器上。我将.htaccess文件放在E:\xampp\htdocs\.htaccess中的htdocs中 RewriteEngine on RewriteBase / # Hide the application and system directories by redirecting the request to index.php RewriteRule ^(application|system|\.svn) index.ph

这是我的
.htaccess
文件。我的xampp安装位于我的
E
驱动器上。我将
.htaccess
文件放在
E:\xampp\htdocs\.htaccess
中的
htdocs

RewriteEngine on
RewriteBase /
# Hide the application and system directories by redirecting the request to index.php
RewriteRule ^(application|system|\.svn) index.php/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [QSA,L]
# Remove www from any URLs that have them:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^www\.
RewriteRule ^(.*)$ http://mobiloka.com/$1 [R=301,L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END 
我试过两种方法:

$config['uri_protocol'] = 'AUTO';
$config['uri_protocol'] = 'REQUEST_URI';

每次我尝试导航到我网站上的另一个页面时,它都会进入仪表板。我应该怎么做才能让它在本地主机上访问我的站点而不必
index.php

看起来您使用的是codeIgniter 2版本

如果已删除将CodeIgniter 3用于uri_协议
Auto

尝试将此htaccess用于xampp。并将其放置在项目的主目录中。应用程序文件夹的外侧

htdocs / 
  your_codeigniter_project_folder / 
  your_codeigniter_project_folder /  application_folder /
  your_codeigniter_project_folder / system_folder /
  your_codeigniter_project_folder / .htaccess
  your_codeigniter_project_folder / index.php
.htaccess

Options +FollowSymLinks
Options -Indexes
DirectoryIndex index.php
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L,QSA]
以及在config.php上

$config['base_url'] = 'http://localhost/your_project_name/';
$config['index_page'] = '';

谢谢你的回答。不幸的是,它仍然会转到localhost/dashboard:(@NouzarWijaya在
E:\xampp\htdocs.htaccess.
上尝试一些htaccess@NouzarWijaya。它看起来像是直接放在htdocs文件夹中,而不是放在项目文件夹中。我已经更新了我的答案。确保所有类和文件名的控制器和模型都有大写字母。可能是
$config['base_url'] = 'http://localhost/your_project_name/';
$config['index_page'] = '';