私の現在の開発では CodeIgniter を使用しています。いくつかのパラメーターをメイン コントローラーのインデックス関数に渡そうとすると、 me が返されます404 error
。
http://localhost/gis/1 -> 404 ERROR
http://localhost/gis/home/1 -> 404 ERROR
実際、私のroute.php
ファイルには次のようなルートがあります。
$route['default_controller'] = "home";
$route['home/([:num])'] = 'home/index/$1';
私の.htaccess
ファイルはこれです(CI URLからindex.phpを取り除くためのこの投稿から):
<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>
# If we don't have mod_rewrite installed, all 404's
# can be sent to index.php, and everything works as normal.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
そして私のconfig.php
ファイル:
$config['base_url'] = "http://localhost/gis";
$config['index_page'] = "";
私は何を間違っていますか?ありがとう!