安装WordPress的(FURLs&高速) -车辆定位系统圣经Nginx的铂13

English 英国(更改)
  • Digg
  • Twitter
  • Technorati
  • del.icio.us
  • Facebook
  • MySpace
  • Reddit
  • StumbleUpon
  • LinkedIn
  • email

成立(4新成员) -第14部分:调整Nginx的WordPress的-漂亮的网址和可湿性粉剂超高速非托管车辆定位系统

nginx的WordPress的标志形象

对于博客平台WordPressNginx的正常工作,我们需要调整Web 服务器的配置 本教程将启用这两个缓存 -整合可湿性粉剂超高速插件- 漂亮的永久链接和激活(FURL秒, 卷曲秒,所有的!)一些简单的重写规则

行,所以你一个WordPress博客。 如果你没有, 迅速采取行动的 否则,你要Nginx的汁,保持在这里。

因为我看到我都喜欢上WordPress的,显然这样是世界和她的妹妹,也因为全能可湿性粉剂需要一点薄层生活Nginx的服务器与幸福,我会清楚说明的要求。

成立了(4新成员)..非托管车辆定位系统 圣经的车辆定位系统

在20个复制/粘贴操作.. 从零到英雄,空白方块可爱的Linux服务器。

向下的全系列指数。

所以,嘿,下跌共享与虚拟万岁!希望有所帮助。the_guv

为什么还要可湿性粉剂超高速缓存?

'产地来源证它处理,交通繁忙,您的网站,破坏者的速度! 有关更多, 在这里看到 本质: -

  • 到Digg,证明您的博客

至于永久链接?

要转换的URI就像www.xyz.com/r/default.asp?iID=HFJJLH&iPostID=JMMGD的www.xyz.com /漂亮,请。 本质: -

  • 实用性强
  • 的搜索引擎优化

可爱的。

WordPress的插件可湿性粉剂超高速和永久链接捆绑

如果你只希望永久链接,而不是缓存, 跳到这里

创建一个新的文件: -

sudo nano /usr/local/nginx/conf/wordpress_params.super_cache

And in there, paste:-

# if the requested file exists, return it immediately
if (-f $request_filename) {
break;
}

set $supercache_file '';
set $supercache_uri $request_uri;

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

# Using pretty permalinks, so bypass the cache for any query string
if ($query_string) {
set $supercache_uri '';
}

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

# if we haven't bypassed the cache, specify our supercache file
if ($supercache_uri ~ ^(.+)$) {
set $supercache_file /wp-content/cache/supercache/$http_host/$1index.html;
}

# only rewrite to the supercache file if it actually exists
if (-f $document_root$supercache_file) {
rewrite ^(.*)$ $supercache_file break;
}

# all other requests go to Wordpress
if (!-e $request_filename) {
rewrite . /index.php last;
}

Save and quit - CTRL-X and Enter.

WordPress Permalinks Without WP Super Cache

If you've added the file above, ignore this section.

Create a file:

sudo nano /usr/local/nginx/conf/wordpress_params.regular

And paste this within:-

# WordPress pretty URLs: (as per dominiek.com)
if (-f $request_filename) {
break;
}
if (-d $request_filename) {
break;
}
rewrite ^(.+)$ /index.php?q=$1 last;
# Enable nice permalinks for WordPress: (as per Yawn.it)
error_page  404  = //index.php?q=$uri;

Save and quit (CTRL-X, 'y' to confirm, then Enter).

Configure Nginx for WordPress Permalinks & WP Super Cache

We'll link to either of those files now, from the virtual host file we created in Part 13: Serve Multiple Sites & Blogs with Virtual Hosts . If you have more than one standalone blog, as per Part 13, you'll have a vhost file for each, and must edit each of them.

Open the vhost file for each WP blog. For instance, for my site waywiderweb, which I've been exampling in this series:-

sudo nano /usr/local/nginx/sites-available/waywiderweb.com

If you want BOTH the WP Super Cache and the friendly URLs

After the line index index.php index.html; , so before the } , paste this:-

# Wordpress WP Super Cache plugin and permalinks.
include /usr/local/nginx/conf/wordpress_params.super_cache;

If you want ONLY the friendly URLs

After the line index index.php index.html; , so before the } , paste this:-

# Wordpress permalinks.
include /usr/local/nginx/conf/wordpress_params.regular;

Restart Nginx:-

n2r

Or, if you didn't follow Part 7: Edit bashrc for User-Friendly Linux , type:-

sudo /etc/init.d/nginx restart

Done. Check your site in a web browser.

I'd like to thank Matt Stevens and Gleb Esman for the Nginx integration.

Next Up, Installing WordPress & Other Platforms with Subversion.

That's it for pretty URIs, friendly URLs, FURLs, CURLs, permalinks or whatever else they're called. And we'll enable the caching when we install the WP Super Cache plugin. Talking of which, in the next how-to guide in this series, we do just that, using super-duper Subversion, with which we'll also simplify the WordPress installation process.

.. Damn, I'm good to you ;)   Guess what ...


SETUP an Unmanaged VPS (4 Newbies) .. The V-P-S Bible

Serve multi sites & blogs on a budget .. at the fastest possible speed .. with the least downtime .. in the most secure environment .. and future-proofed for easy admin.

That's what the VPS Bible is about, stepped out in simple copy & paste guides.

From high traffic WordPress blogs to startup web hosts, here's what you need.

Set it up?   Click here for the 21 part follow-up .. V-P-S Admin

.