www.mydomain.com/test の Godaddy サブドメインに CI をインストールしました。ホームページと /news ページへのリンクが読み込まれます。
私が抱えている問題は、ロードする画像や CSS ファイルをロードできないことです。次の方法で、ヘッダー ファイルから CSS を呼び出しています。
<link rel="stylesheet" type="text/css" href="<?php echo base_url() ?>inc/css/base.css" media="all"/>
私はヘッダー画像を次の方法で呼び出しています:
<img src="images/logo.png">
画像があるはずの X を右クリックし、[新しいタブで開く] を選択して、それが指している URL を確認できるようにします... 良さそうです。 http://mydomain.com/test/images/logo.png
site_url と base_url をエコーしましたが、正しく設定されているようです: http://www.mydomain.com/test/
私の構造は次のとおりです: /test
1 index.php
2.htaccess
3 /システム
4 /アプリケーション
- /コントローラ
- /画像
- /inc
--- /css
--- /js - /ビュー
stackoverflow の質問を確認した後... www.mydomain.com/test フォルダーにある .htaccess を次の CI と共に貼り付けました。
RewriteEngine On
RewriteBase /test
RewriteCond %{REQUEST_URI} ^system.*
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteCond %{REQUEST_URI} ^application.*
RewriteRule ^(.*)$ /test/index.php?/$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]
私のconfig.phpは次のとおりです。
$config['base_url'] = 'http://www.mydomain.com/test/';
$config['index_page'] = "";
$config['uri_protocol'] = "AUTO";