ルートのサブフォルダーに codeigniter をインストールしています。アプリケーションにアクセスするための現在の URL は次のようになります。
http://www.site.com/subfolder/index.php/controller/action
index.php
URLから削除したいので、.htaccess
ファイルを作成しました。ファイルは次のようになります。
Options -Indexes
Options +FollowSymLinks
RewriteEngine on
RewriteBase /subfolder
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
そして私も編集しました
$config['index_page'] = 'index.php';
に:
$config['index_page'] = '';
と:
$config['uri_protocol'] = 'root';
に:
$config['uri_protocol'] = 'REQUEST_URI';
次に、URLを試しました:
www.site.com/subfolder/controller/action
しかし、Not found
エラーページが表示されます.URLを次のように編集すると、ページが機能するようになりました。
www.site.com/subfolder/?/controller/action