2016-03-18 15 views
0

既存のyiiプロジェクトに管理パネルを作成したいと思います。このため、私はthis linkを使用しています。yii管理セクションの設定

"localhost/dir/backend.php"にアクセスできました。私はこのURLを "localhost/dir/backend"としたいと思っていますし、管理者のログインやその他のリンクの管理もしたいと思っています。 私のconfigファイルのコードは

'urlManager' => array(
    'urlFormat' => 'path', 
    'showScriptName' => false, 
    'rules' => array(
     'admin' => 'site/index', 
     'admin/<_c>' => '<_c>', 
     'admin/<_c>/<_a>' => '<_c>/<_a>', 
    ), 
), 

がどのように管理するためのURLとログインURLや他のURLの上にアクセスする方法を教えてくださいです。 おかげで、あなたは、Apache上でアプリケーションを実行している場合

答えて

0

は、次のルールでの.htaccessアプリのルートを追加する必要が

RewriteEngine on 
# if a directory or a file exists, use it directly 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
# otherwise forward it to index.php 
RewriteRule . index.php 
関連する問題