2017-04-04 58 views
0

我昨天发布了关于从codeigniter路径中删除索引点PHP的问题,但问题没有解决......所以任何一个人都可以来团队查看器和解决我的问题......?感谢在期待codeigniter url造成错误在去除index.php

我的.htaccess在根文件夹

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

您是否在Web服务器上启用了重写模式? –

回答

1

你有你的.htaccess文件移动到的index.php存在目录,如果存在从应用程序目录中删除。

然后将以下代码粘贴到.htaccess文件中。

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

我假设你已经执行的其他步骤包括在WAMP打开重写引擎,并在config.php

$config['index_page'] = 'index.php'; 

$config['index_page'] = ''; 

还设置

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

我希望它帮助。

+0

尝试但错误.............................................. .........................................未找到 请求的URL/si/public/signup在此服务器上找不到。 Apache/2.4.9(Win64)PHP/5.5.12服务器在localhost端口80 –

+0

如何打开WAMP中的重写引擎 –

+0

click:** WAMP icon-> Apache-> Apache模块 - >选择rewrite_module ** 和**重新启动所有服务** –