Archive for March, 2010

约定之日

国土炼成阵
121227lyw 约定之日

Filed in: 猫言猫语
9

nginx 的 wordpress rewrite 和WP Super Cache rewrite规则

wordpress.conf

if (-f $request_filename/index.html){
rewrite (.*) $1/index.html break;
}
if (-f $request_filename/index.php){
rewrite (.*) $1/index.php;
}
if (!-f $request_filename){
rewrite (.*) /index.php;
}

supercache.conf

location /
{
autoindex off;
gzip_static on;

set $wp_super_cache_file '';
set $wp_super_cache_uri $request_uri;

if ( $request_method = POST )
{
set $wp_super_cache_uri '';
}

if ( $query_string )
{
set $wp_super_cache_uri '';
}

if ( $http_cookie ~* "comment_author_|wordpress|wp-postpass_" )
{
set $wp_super_cache_uri '';
}

if ( $wp_super_cache_uri ~ ^(.+)$ )
{
set $wp_super_cache_file /wp-content/cache/wp_super_cache/$http_host/$1index.html;
}

if ( -f $document_root$wp_super_cache_file )
{
rewrite ^(.*)$ $wp_super_cache_file break;
}

if (-f $request_filename)
{
expires 30d;
break;
}

if (!-e $request_filename)
{
rewrite ^(.+)$ /index.php?q=$1 last;
}
}
Filed in: WordPress
16

一步一步教你安装Nginx+PHP+Mysql

发现很多VPS用LNMP一键安装包都 失败,有不能排错,唯有给出教程,一步一步教你安装,所谓授人于鱼不如授人于渔嘛,本文是在CentOS 5.4 操作系统下测试通过的,用的是DiaHosting上 的32位系统,为什么要用32位系统?就是为了节省内存,VPS内存都不是很多的,纯32位系统比X86_X64兼用32位系统更省内存.

安装步骤:
Read more...

Filed in: Linux
56
© 2007-2010 猫言猫语. All rights reserved. Powered by WordPress. 2 queries in 0.102 seconds.
Proudly designed by Theme Junkie.