2017-01-29 115 views
0

我真的需要帮助, 相同的标题,我的问题是我笨无法删除的index.php笨不能删除的index.php

我曾尝试了很多的.htaccess代码,如:

// first 
<IfModule mod_rewrite.c> 
RewriteEngine On 
RewriteBase /projectFolderName/ --> i already change to my project name 

RewriteCond %{REQUEST_URI} ^system.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

RewriteCond %{REQUEST_URI} ^application.* 
RewriteRule ^(.*)$ /index.php?/$1 [L] 

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

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

//third 
RewriteEngine On 
RewriteCond %{REQUEST_FILENAME} -s [OR] 
RewriteCond %{REQUEST_FILENAME} -l [OR] 
RewriteCond %{REQUEST_FILENAME} -d 
RewriteRule ^.*$ – [NC,L] 
RewriteRule ^(.*)$ index.php/$1 [NC,L] 

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

我不得不改变我的配置一样

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

在一些参考 我httd.conf

<Directory /> 
    AllowOverride All 
    Require all denied 
</Directory> 

我的移动的.htaccess主项目文件夹(不应用程序) 但都不起作用

+0

你应用程序文件夹的侧面放置htacces不出来里面。 – user4419336

+0

感谢您的回答,是的,我做了 我尝试了两个但不是同一时间,地方 - >重新加载页面,并放置在外面 - >重新加载页面,但它不工作之前 现在这个问题解决了,我认为问题是在浏览器缓存 –

回答

0

你忘记设置base_urlapplication/config/config.php .SET您base_url

$config['base_url'] = 'your_url'; 

在根文件夹.htaccess

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

而且还

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

在这里工作很好..

+0

呀!它的工作,在第一个.htaccess代码,我发布我有写基地的网址,但它没有工作,真的。它让我疯狂。但现在其工作 无论如何谢谢你的帮助 –

+0

是否因为浏览器上的缓存?或者是什么? –

+0

有时可能是由于缓存。 –