我當前的URL看起來像這樣:笨:在.htaccess子域後刪除的index.php
http://www.example.com/testdesign/index.php/tasks
,我需要它重定向到:
http://www.example.com/testdesign/tasks
我codeignitor根.htaccess文件包含
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteCond %{REQUEST_URI} !/system/.* [NC]
RewriteRule (.?)index\.php/(.*) /$1$2 [R=301,NE,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>
mod_rewrite在我的apache服務器上啓用。
在我的配置文件:
$config['index_page'] = '';
$config['uri_protocol'] = 'REQUEST_URI';
當我從本地主機運行它,它讓我看到這樣的:
http://www.example.com/tasks
但我想刪除的index.php不僅沒有子域。
我知道這可能是一個非常小的問題,但我無法找到錯誤。
請您給我適當的建議嗎?
任何形式的幫助將不勝感激。
在此先感謝。
也許你應該讀這個:[http:// stackoverflo w.com/a/41364059/6054930](http://stackoverflow.com/a/41364059/6054930)。 – ShutUpMagda
@ShutUpMagda,我已經閱讀過這份文件,並且適用,但是不能正常工作。 –
我也注意到使用'site_url()'而不是'base_url()'是造成這個問題的原因之一。 – ShutUpMagda