XAMPP を使用して Windows で動作する codeigniter プロジェクトがあり、それを RaspberryPi に移動していました。
- アパッチ/2.2.22 (デビアン)
- PHP 5.4.4-14+deb7u5
- mysql バージョン 14.14 ディストリビューション 5.5.31
このestructureには2つのcodeignitirアプリケーション(プリンシパルとパネル)があります
/ -> (apache root folder)
/appname/admin
/admin/application/ -> (codeigniter application to panel)
/appname/application/ -> (codeigniter application to public)
今、管理コントローラーにアクセスできません。.htaccess が原因だと思います。私はいくつかのURLでこれを取得します: my.domain/appname -> codeigniterwelcome for public (この部分は空なので問題ないと思います) my.domain/appname/admin/login.html -> Not Found. 要求された URL /mydomain/admin/login がこのサーバーで見つかりませんでした。my.domain/appname/admin/index.php?controller=admin -> 404 Page Not Found (codeigniter スタイル) my.domain/appname/admin/hello.html -> こんにちは (私が試してみたダミーファイルは正常に動作します) )
私のコードイグナイターパネルプロジェクトで私は持っています
$config['base_url'] = 'http://my.domain/myapp/admin/';
$config['index_page'] = '';
$config['uri_protocol'] = 'AUTO';
$config['url_suffix'] = '.html';
.htaccess がすべてだと思いますが、理解できません。必要なファイル数は? 何のフォルダ?
以前に /appname と /appname/panel にこの .htaccess がありました
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /appname #to panel /appname/panel
#Removes access to the system folder by users.
#Additionally this will allow you to create a System.php controller,
#previously this would not have been possible.
#‘system’ can be replaced if you have renamed your system folder.
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php/$1 [L]
#Checks to see if the user is attempting to access a valid file,
#such as an image or css document, if this isn’t true it sends the
#request to index.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
RewriteRule .* index.php/$0 [PT,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>
私のApache2ではRewriteEngine onが有効になっていると思います。