これは私のアプリケーションのスケルトンです:
application
    controllers
        backend
            [backend_controllers_here]
        [frontend_controllers_here]
    models
        [shared_models_for_both_backend_and_frontend]
    views
        backend
            [backend_views_here]
        [frontend_views_here]
    ...
system
index.php
.htaccess
これは私の .htaccess ファイルの内容です:
Options -Indexes
Options +FollowSymLinks
# Set the default file for indexes
# DirectoryIndex index.php
<IfModule mod_rewrite.c>
    # activate URL rewriting
    RewriteEngine on
    # do not rewrite links to the documentation, assets and public files
    RewriteCond $1 !^(images|assets|uploads|captcha)
    # do not rewrite for php files in the document root, robots.txt or the maintenance page
    RewriteCond $1 !^([^\..]+\.php|robots\.txt)
    # but rewrite everything else
    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.
    ErrorDocument 404 index.php
</IfModule>  
アドレスバーに次のようなものを入力しても問題ありません(フロントエンド用):
- mysite.local
- mysite.local/index.php
- mysite.local/index.php/frontend_controller
- mysite.local/frontend_controller
しかし、バックエンドの場合、アクセスしようとすると403 エラーが発生しました:
- mysite.local/バックエンド
- mysite.local/backend/some_backend_controller
ただし、URL に index.php を使用すると、すべて問題ありません。
- mysite.local/index.php/バックエンド
- mysite.local/index.php/backend/some_backend_controller
ここで何か不足していますか?
御時間ありがとうございます!