产品服务AMH 免费服务器主机面板SSL证书 免费SSL证书申请 担保单 免费安全、零费率交易平台编程助手免费智能写代码、翻译AMYSQL 免费MySQL管理工具

AMH 社区首页

 AMH社区 - 开放自由有价值的社区

[求助帖] 谁能介绍下WordPress中WP Super Cache插件的静态规则在AMH中的添...

nano
铜牌会员
583.84 价值分

nano 发表于 2014-09-10 18:52:11
谁能介绍下WordPress中WP Super Cache插件的静态规则在AMH中的详细添加方法。
目前是用官方的 wordpress.conf 无法开启WP Super Cache的 mod_rewrite 缓存模式。

提示如下:
Mod rewrite 模块可能未安装!貌似 mod_rewrite 模块尚未安装。也许情况并不是这样,尤其是当您不使用 Apache 作为服务器程序的时候。请检查 mod_rewrite 模块是否被加载。这对于 Super Cache 的静态文件的调用是必需的。不过您可以使用 PHP 缓存模式或者传统模式运行本插件。
经查询资料,WordPress Super Cache插件在AMH下的伪静态规则如下:

# WP Super Cache rules.# Designed to be included from a 'wordpress-ms-...' configuration file.set $cache_uri $request_uri;# POST requests and urls with a query string should always go to PHPif ($request_method = POST) { set $cache_uri 'null cache';}if ($query_string != "") { set $cache_uri 'null cache';} # Don't cache uris containing the following segmentsif ($request_uri ~* "(/wp-admin/|/xmlrpc.php|/wp-(app|cron|login|register|mail).php|wp-.*.php|/feed/|index.php|wp-comments-popup.php|wp-links-opml.php|wp-locations.php|sitemap(_index)?.xml|[a-z0-9_-]+-sitemap([0-9]+)?.xml)") { set $cache_uri 'null cache';} # Don't use the cache for logged in users or recent commentersif ($http_cookie ~* "comment_author|wordpress_[a-f0-9]+|wp-postpass|wordpress_logged_in") { set $cache_uri 'null cache';}# START MOBILE# Mobile browsers section to server them non-cached version. COMMENTED by default as most modern wordpress themes including twenty-eleven are responsive. Uncomment config lines in this section if you want to use a plugin like WP-Touch# if ($http_x_wap_profile) {# set $cache_uri 'null cache';#}#if ($http_profile) {# set $cache_uri 'null cache';#}#if ($http_user_agent ~* (2.0\ MMP|240x320|400X240|AvantGo|BlackBerry|Blazer|Cellphone|Danger|DoCoMo|Elaine/3.0|EudoraWeb|Googlebot-Mobile|hiptop|IEMobile|KYOCERA/WX310K|LG/U990|MIDP-2.|MMEF20|MOT-V|NetFront|Newt|Nintendo\ Wii|Nitro|Nokia|Opera\ Mini|Palm|PlayStation\ Portable|portalmmm|Proxinet|ProxiNet|SHARP-TQ-GX10|SHG-i900|Small|SonyEricsson|Symbian\ OS|SymbianOS|TS21i-10|UP.Browser|UP.Link|webOS|Windows\ CE|WinWAP|YahooSeeker/M1A1-R2D2|iPhone|iPod|Android|BlackBerry9530|LG-TU915\ Obigo|LGE\ VX|webOS|Nokia5800)) { # set $cache_uri 'null cache';#}#if ($http_user_agent ~* (w3c\ |w3c-|acs-|alav|alca|amoi|audi|avan|benq|bird|blac|blaz|brew|cell|cldc|cmd-|dang|doco|eric|hipt|htc_|inno|ipaq|ipod|jigs|kddi|keji|leno|lg-c|lg-d|lg-g|lge-|lg/u|maui|maxo|midp|mits|mmef|mobi|mot-|moto|mwbp|nec-|newt|noki|palm|pana|pant|phil|play|port|prox|qwap|sage|sams|sany|sch-|sec-|send|seri|sgh-|shar|sie-|siem|smal|smar|sony|sph-|symb|t-mo|teli|tim-|tosh|tsm-|upg1|upsi|vk-v|voda|wap-|wapa|wapi|wapp|wapr|webc|winw|winw|xda\ |xda-)) { # set $cache_uri 'null cache';#}#END MOBILE# Use cached or actual file if they exists, otherwise pass request to WordPresslocation / { try_files /wp-content/cache/supercache/$http_host/$cache_uri/index.html $uri $uri/ /index.php?$args ;}
问题是这个规则怎么使用?
使用AMH中的AMRewrite 添加该规则,PHP加载失败。谁知道怎么用呀?






2014-09-10 18:52:11 1

nano
铜牌会员
583.84 价值分

amh 4.2版本的 centos 6.5
  支持 (0分)  反对 (0分)
回复  2014-09-10 19:04:51 2

tanyuxiang
金牌会员
5420.37 价值分

先分清apache规则和nginx规则。
  支持 (0分)  反对 (0分)
回复  2014-09-11 19:56:57 3

x2012qq
银牌会员
2200.74 价值分

AMH管理面板里装个插件不就行了 什么规则都有,装好之后再对虚拟主机设置指定的规则即可啊
  支持 (0分)  反对 (0分)
回复  2014-09-12 04:25:16 4

wangxingcs
银牌会员
2811.15 价值分

用WP Super Cache的PHP 缓存模式,各种环境都兼容
  支持 (0分)  反对 (0分)
回复  2014-09-12 09:38:25 5
 1  (总1页)
AMH社区列表
用户服务中心