0

ユーザーが /prefiltered/ と入力したときに /index.php?events/ の内容を確認できるようにしたい。だから、彼らのブラウザに /index.php?events/ を表示させたくありません。リマッピングと呼ばれるものだと思います。

私は CodeIgniter を使用しており、ローカルで作業しています。はい、Apache サーバーで mod_rewrite を有効にしました。

私はこれを試していますが、肯定的な結果はありません:

# CodeIngniter Configuration
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]

# What I want to get to work
RewriteEngine On
RewriteRule ^prefiltered/? /index.php?events/ [NC,L]

前もって感謝します。

4

1 に答える 1

1

これをルーティングと呼びます。/application/routes.php ファイルで行う必要があります。htaccess ファイルは次のようにする必要があります。

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

そして、routes.php に次の行を追加します。

$route['events'] = "prefiltered";

それが役に立てば幸い。

于 2013-05-31T02:02:29.547 に答える