この質問が何度も寄せられていることは承知しています。過去 2 日間でいくつかの解決策を試しましたが、何も役に立ちませんでした。
誰か助けてください。
使用するCI 2.1.2
と、次のフォルダー構造があります。
appcliaction/controllers/admin/book.php
public_html/assets
public_html
私のファイルにはこれがありますindex.php
:
$application_folder = '../application';
私のroutes.phpファイルには次のものがあります:
$route['admin'] = 'admin/book';
私の設定ファイルでは:
$config['index_page'] ='';
$config['uri_protocol'] = 'AUTO';//I tried all the options here
私のhtaccessファイル:
Options +FollowSymLinks
Options -MultiViews
DirectoryIndex index.php
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond $1 !^(index\.php|images|public|robots\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule ^(.*)$ index.php?/$1 [L,QSA]
RewriteRule ^(.*)$ ./index.php?/$1 [L]
</IfModule>
## EXPIRES CACHING ##
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access 1 year"
ExpiresByType image/jpeg "access 1 year"
ExpiresByType image/gif "access 1 year"
ExpiresByType image/png "access 1 year"
ExpiresByType image/x-icon "access 1 year"
</IfModule>
私のブックコントローラーAdmin_Controller
は、ライブラリ フォルダーから を拡張します。
Admin_Controller
:_
function __construct ()
{
parent::__construct();
$this->data['meta_title'] = 'ThinklocalCMS';
$this->load->helper('form');
$this->load->library('form_validation');
$this->load->library('session');
// Login check
$exception_uris = array(
'auth/login',
'auth/logout'
);
if (in_array(uri_string(), $exception_uris) == FALSE)
{
if(!$this->ion_auth->logged_in())
redirect('auth/login');
else
$this->data['username'] = $this->session->userdata('username');
}
}
行きmysite.co.za/admin
ますPage Not Found
(もちろん、これは私のローカルマシンで正常に動作しています)。
に行くとmysite.co.za/admin/book
、ion_auth
ログイン画面が表示されます。これが起こるはずです。
誰か助けてください。Googleで見つけたすべての投稿で解決策を見つけようとしました。