标签:
sourceforge免费空间申请及使用笔记
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
利用.htaccess启动Gzip网页压缩。这方法是通过阿帕契(Apache)的Enabling Compression来达到。请通过FTP将您的.htaccess文件下载回来,如果没有请用记事本建立一个,储存时类型请选择所有文档,然后档名输入.htaccess即可。在.htaccess文件中请加入以下语法,然后储存上传覆盖即可。
<IfModule mod_deflate.c>
# Insert filters
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
AddOutputFilterByType DEFLATE application/x-httpd-php
AddOutputFilterByType DEFLATE application/x-httpd-fastphp
AddOutputFilterByType DEFLATE image/svg+xml
# Drop problematic browsers
BrowserMatch ^Mozilla/4 gzip-only-text/html
BrowserMatch ^Mozilla/4.0[678] no-gzip
BrowserMatch bMSI[E] !no-gzip !gzip-only-text/html
# Make sure proxies don‘t deliver the wrong content
Header append Vary User-Agent env=!dont-vary
</IfModule>
Header文件中添加
<?php
//SF.NET空间去缓存
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . "GMT");
//cache更新时间
header("Cache-Control: no-cache, must-revalidate, no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
//不缓存网页
header("Pragma: no-cache")
?>
?
?
备注:
sourceforge空间虽然完全免费,但是速度一般,而且关于文件读写问题也是比较恼火的,并且它是在工程空间中,所以对FTP的支持方面不好,文件上传什么的都比较麻烦。另外这种空间就和GAE、SAE一样,是用来做开源项目的,所以还是不要浪费资源了。
?
?
^_^Bruce Lone
2015-2-6
标签:
原文地址:http://www.cnblogs.com/BruceLone/p/4276845.html