#WP Permalinks rewrite
rewrite ^.*/files/(.*)$ /wp-includes/ms-files.php?file=$1 last;
if (!-e $request_filename) {
rewrite ^.+?(/wp-.*) $1 last;
rewrite ^.+?(/.*\.php)$ $1 last;
rewrite ^ /index.php last;
}
#WP-super-cache rewrite
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/supercache/$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;
}
10 Responses to Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache
Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache | KuAPP.com - Cool Application for Ubuntu and *nix !
六月 30th, 2010 at 6:12 上午
[...] via: http://v.riku.me/9.html [...]
Tweets that mention Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache | riku@VPS#> -- Topsy.com
六月 30th, 2010 at 3:26 下午
[...] This post was mentioned on Twitter by Bentejuí, Nginx Tips. Nginx Tips said: Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache http://twurl.nl/uy0sir [...]
吾吖攷 » Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache
七月 1st, 2010 at 12:50 上午
[...] via: http://v.riku.me/9.html [...]
» PHP 5.3.3 发布,内置 Php-FPM 模块 Wow! Ubuntu / Ubuntu 新闻、技巧及软件!
七月 29th, 2010 at 3:08 上午
[...] 附:WordPress 3.0 Permalinks 和 WP-super-cache 的 Nginx rewrite 规则 [...]
» 小内存 VPS 优化建议 (LNMP+Wordpress 环境) Wow! Ubuntu / Ubuntu 及 Linux 新闻、技巧、软件及游戏!
十二月 23rd, 2010 at 2:14 下午
[...] Nginx 服务器,而对于 WordPress 来说 nginx 已经完全够用了。这里是适用于 WordPress 3 的 nginx rewirte 规则,包括 Permalinks rewrite 及 WP-super-cache [...]
gfrog
十二月 24th, 2010 at 12:40 上午
"set $wp_super_cache_file /wp-content/cache/wp_super_cache/$http_"
这行有错误,显然是复制过来的时候抄错了。
[Reply]
riku Reply:
十二月 24th, 2010 at 9:47 上午
@gfrog, 好的,改了,多谢提醒。
[Reply]
links for 2010-12-30 « Yesure
十二月 31st, 2010 at 9:03 上午
[...] » Nginx rewrite rules of WordPress 3.0 Permalinks and WP-super-cache Wow! Ubuntu / Ubuntu 及 Linux... rewite rule of nginx (tags: vps nginx webdev wordpress) [...]
小内存 VPS 优化建议 (LNMP+WordPress 环境) | Wang Jun's Blog
一月 8th, 2011 at 12:13 下午
[...] Nginx 服务器,而对于 WordPress 来说 nginx 已经完全够用了。这里是适用于 WordPress 3 的 nginx rewirte 规则,包括 Permalinks rewrite 及 WP-super-cache [...]
小内存 VPS 优化建议 (LNMP+WordPress 环境) | Leafiy™/一切好玩的/新鲜的/Hear your voice-Clear your sight
四月 13th, 2011 at 10:48 下午
[...] Nginx 服务器,而对于 WordPress 来说 nginx 已经完全够用了。这里是适用于 WordPress 3 的 nginx rewirte 规则,包括 Permalinks rewrite 及 WP-super-cache [...]