我無法從Codeigniter中的URL中刪除index.php。我和笨1.7做了一些網站和我過去在2從URL刪除index.php - Codeigniter 2
不起作用的.htaccess代碼,我使用
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
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>
和
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule ^(.*)$ ./index.php/$1 [L]
</IfModule>
我試着也試過它沒有RewriteBase /英寸
我已經改變了$ config ['uri_protocol'] REQUEST_URI和QUERY_STRING和沒有。
我已經設置了$ config ['index_page'] =「」;
文件結構是192.168.0.130/(site)/,所以它必須回到服務器的根目錄,並且找不到index.php文件。
所有我所作出的控制器可以通過將192.168.0.130/(site)/index.php/testcontroller
謝謝到達。
道歉,如果這已被問及之前 - 我看了,並嘗試我可以看到。
編輯:
我還要補充一點,我改變了默認文件夾是
應用
CI-2.0
的index.php
和修改的路徑中index.php是正確的。
你有沒有在父文件夾中的任何htaccess文件? – timwebdev
有一個htaccess文件。它只有一行,它是一個不同的項目 - 我只是試着評論它,但它沒有做任何事情。 – Paul
Btw:系統和應用程序RewriteConds必須以/ SUBFOLDER/ – timwebdev