0
我有問題與圖像鏈接在CSS文件,順便說一句我用google minify tool如果這可能會導致問題?用谷歌工具縮小後的css圖像鏈接
我用圖像中的CSS是這樣的:
background: url('../images/image.png');
和形象在網站上沒有顯示,因爲地址:
http://domain.com/domain.com/public/images/image.png
和正確的鏈接應該是:
http://domain.com/public/images/image.png
domain.com是我的託管文件夾,所以它增加了該文件夾,我該如何解決這個問題?
這是的.htaccess代碼:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{HTTP_HOST} !^domain.com$ [NC]
RewriteRule ^(.*)$ http://domain.com/$1 [L,R=301]
RewriteCond %{REQUEST_URI} ^system.*
RewriteRule ^(.*)$ /index.php?/$1 [L]
RewriteCond %{REQUEST_URI} ^application.*
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
RewriteCond $1 !^(index\.php|images|robots\.txt|css)
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.
# Submitted by: ElliotHaughin
ErrorDocument 404 /index.php
</IfModule>
<IfModule mod_expires.c>
# Enable expirations
ExpiresActive On
# My favicon
ExpiresByType image/x-icon "access plus 1 year」
# Images
ExpiresByType image/gif "access plus 7 days"
ExpiresByType image/png "access plus 7 days"
ExpiresByType image/jpg "access plus 7 days"
ExpiresByType image/jpeg "access plus 7 days"
# CSS
# ExpiresByType text/css "access plus 7 days"
# Javascript
ExpiresByType application/javascript "access plus 7 days"
</IfModule>
<IfModule mod_headers.c>
Header append Cache-Control "public"
</IfModule>
任何解決方案?
您應該將此添加到主要問題中,而不是將其作爲答案發布。除此之外,你的問題充滿了糟糕的語法,幾乎難以辨認。 – Jules