我以前有一些mod_rewrite錯誤,用一個簡單的;,子域上的Codeigniter鏈接樣式表和javascripts
這個問題已得到解決。 所以再次的結構,我有一個子域上的codeigniter應用程序。例如。 test.site.com
HTTPS-vhost.conf文件
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot "C:/xampp/htdocs/test"
ServerName test.localhost.com
</VirtualHost>
我位於我的應用程序,(htdocs中/測試/)
<IfModule mod_rewrite.c>
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} !www.localhost.com$ [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteCond %{HTTP_HOST} ^(www.)?([a-z0-9-_]+).localhost.com [NC]
RewriteRule (.*) /index.php/ [P]
RewriteCond $1 !^(index\.php|images|robots\.text|css|js)
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
所以的基部夾.htaccess文件,我現在可以加載CI_controllers,但是,我似乎無法鏈接任何樣式表或JavaScript文件。
這些文件都位於一個資產的文件夾,像這樣
htdocs
|-test
| |-application
| |-assets
| | |-css
| | | |-style.css
| | |-js
| | | |-jquery.js
即使一個完整的網站鏈接,我似乎不能加載這些文件,
Request URL: http://test.localhost.com/assets/css/style.css
Request Method: GET
Status Code: 404 Not Found
我需要創建特定的路線爲此呢?
嘗試資產在你的URL大寫的A。 –
對不起,這是我的錯字,一切都是小寫, – Lars