好的,所以我尝试使用两个.htaccess文件来加载内容:http://staging.rjs-creative.com和http://cdn.rjs-creative.com上的内容,以便在staging.rjs-creative.com/test上显示字体来自cdn.rjs-creative.com/fonts/的.php - 但它似乎没有用,我在这里疯了!
我的ACCESS日志通过cdn子域显示:
[14 / May / 2015:11:10:53 -0400]“GET /fonts/Hoverage-Vintage.otf HTTP / 1.0“200 582”cdn.rjs-creative.com/css/stylesheet.min.css“ “Mozilla / 5.0(Windows NT 6.1; WOW64)AppleWebKit / 537.36(KHTML,like Gecko)Chrome / 42.0.2311.135 Safari / 537.36“
通过分段子域的ERROR日志显示:
[2015年5月14日10:26:20] [错误] [客户端5.189.144.88]目录 Options指令禁止的索引: /var/www/vhosts/rjs-creative.com/httpdocs /
我的CDN HTACCESS如下..
Header unset ETag FileETag None
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public"
Header set Expires "Thu, 15 Apr 2018 20:00:00 GMT"
Header set Last-Modified "Thu, 7 Nov 2013 12:00:00 GMT"
</FilesMatch>
<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE
Header set Expires "Thu, 15 Apr 2018 20:00:00 GMT"
</FilesMatch>
AddDefaultCharset utf-8 Header append Vary: Accept-Encoding
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl|webm)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
Header set Access-Control-Allow-Origin "*"
现在我的STAGING HTACCESS如下......
<FilesMatch ".(eot|ttf|otf|woff)">
Header set Access-Control-Allow-Origin "*"
</FilesMatch>
Header unset ETag FileETag None
<FilesMatch "\.(ico|pdf|flv|jpg|jpeg|png|gif|swf|mp3|mp4)$">
Header set Cache-Control "public" Header set Expires "Thu, 15 Apr 2018 20:00:00 GMT"
Header set Last-Modified "Thu, 7 Nov 2013 12:00:00 GMT"
</FilesMatch>
<FilesMatch "\.(html|htm|xml|txt|xsl)$">
Header set Cache-Control "max-age=7200, must-revalidate"
</FilesMatch>
<FilesMatch "\.(js|css)$">
SetOutputFilter DEFLATE Header set Expires "Thu, 15 Apr 2018 20:00:00 GMT"
</FilesMatch>
AddDefaultCharset utf-8 Header append Vary: Accept-Encoding
<IfModule mod_mime.c>
AddType application/vnd.ms-fontobject eot
AddType application/x-font-ttf .ttf
AddType font/opentype otf
AddType application/x-font-woff woff
AddType image/svg+xml svg svgz
AddEncoding gzip svgz
</Ifmodule>
<IfModule mod_deflate.c>
AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
</Ifmodule>
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript
<IfModule mod_gzip.c>
mod_gzip_on Yes
mod_gzip_dechunk Yes
mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$
mod_gzip_item_include handler ^cgi-script$
mod_gzip_item_include mime ^text/.*
mod_gzip_item_include mime ^application/x-javascript.*
mod_gzip_item_exclude mime ^image/.*
mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.*
</IfModule>
<IfModule mod_expires.c>
ExpiresActive On
ExpiresDefault "access plus 1 year"
</IfModule>
<ifModule mod_headers.c>
Header set Connection keep-alive
</ifModule>
Header add Access-Control-Allow-Origin "*"
Header add Access-Control-Allow-Headers "origin, x-requested-with, content-type"
Header add Access-Control-Allow-Methods "PUT, GET, POST, DELETE, OPTIONS"
在使用.htaccess文件方面,我并不是很出色,但是我为首席开发人员工作的公司指导我使用同样的.htaccess布局,当我们在那里开发网站时它似乎工作正常。
我已将我的.htaccess设置为执行301重定向,以显示htaccess肯定正在初始化。 Eugh。