2016-09-26 82 views
0

我想从我的网站删除index.php。我尝试了这些步骤,但仍无法正常工作:index.php删除后找不到页面

  • $config[index_page] = '';
  • 添加了这个从系统文件夹中的.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase/seotutor/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ index.php/$1 [L] </IfModule>
  • 在WAMP的阿帕奇启用了mod_rewrite
  • 覆盖所有ht​​td.conf

回答

2

试试这个:

步骤:-1打开th e文件夹“application/config”并打开文件“config.php”。在config.php文件中找到并替换下面的代码。

//find the below code 
$config['index_page'] = "index.php" 
//replace with the below code 
$config['index_page'] = "" 

步骤:-2转到您的CodeIgniter文件夹并创建的.htaccess

Path: 
Your_website_folder/ 
application/ 
assets/ 
system/ 
.htaccess <——— this file 
index.php 

步骤:-3下面写下代码在.htaccess文件

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

步骤:-4有些情况下,uri_protocol的默认设置无法正常工作。为了解决这个问题只需要打开文件“的application/config/config.php文件”,然后查找和替换下面的代码

//find the below code 
$config['uri_protocol'] = "AUTO" 
//replace with the below code 
$config['uri_protocol'] = "REQUEST_URI" 

这将帮助你。

+0

嗨,我试过这个步骤,但它仍然无法正常工作,Sign Up正在进入正确的页面。 – Dev