CI が持っている URL トリックを利用できるように、index.php を削除するにはどうすればよいですか? 「index.php」を削除すると、必要なクラスがコントローラーに存在する場合でも、404 エラーまたは 403 が発生します。
現在、ルートにある私の .htaccess は次のとおりです。
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
config.php のその他の CI 仕様:
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
rewrite_module が有効になっています。
httpd.conf で:
<Directory />
Options FollowSymLinks
AllowOverride None
Order Allow,Deny
Allow from all
</Directory>
編集:明確にするために、アプリの「ホームページ」にアクセスできます(http://localhost/projectfolder
)。ただし、特定のコントローラー ( http://localhost/projectfolder/admin
) にアクセスすると、機能しません。しかし、index.php がホストとコントローラ ( http://localhost/projectfolder/index.php/admin
) の間にある場合は機能します。間にある「index.php」を解決しようとしています。