2017-04-13 32 views
-1

我在刪除index.php時遇到了一些大問題。作爲一般規則下的.htaccess已經過測試,在幾個服務器和一般的工作原理:如何從codeigniter中的url中刪除index.php

如何刪除下面的鏈接的index.php在笨 http://localhost/test/index.php/home/plans

+0

低於htaccess的?關於這一點已經有很多問題了。 http://stackoverflow.com/questions/6809373/remove-index-php-from-url-codeigniter?rq=1 http://stackoverflow.com/questions/6201409/how-to-remove-index-php-from -codeigniter-url?rq = 1 http://stackoverflow.com/questions/5155333/remove-index-php-from-url-codeigniter-2?rq=1 http://stackoverflow.com/questions/9368543/remove -index-php-from-codeigniter-urls?rq = 1 – Tom

+0

在根文件夾中創建.htaccess文件並將其過去[code](http://stackoverflow.com/questions/43364031/redirection-issues-in-live-服務器/ 43364089#43364089) –

+0

上 RewriteBase RewriteEngine敘述/ 的RewriteCond%{} REQUEST_FILENAME!-f 的RewriteCond%{} REQUEST_FILENAME!-d 重寫規則。*的index.php/$ 0 PT,L] – user3294120

回答

0

你必須添加.htaccess文件在你的根文件夾。

DirectoryIndex index.php 
RewriteEngine on 

RewriteCond $1 !^(index\.php|(.*)\.swf|forums|images|css|downloads|jquery|js|robots\.txt|favicon\.ico) 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^(.*)$ ./index.php?$1 [L,QSA] 

保存此文件的.htaccess在系統文件夾