Wordpress 带有Lighttpd和PHP-FPM的永久链接
我在服务器安装中使用Lighttpd,permalinks与PHP FastCGI配合得很好。但最近我用PHP-FPM更改了FastCGI,我的自定义永久链接不再工作 每次我点击一个帖子/页面,wordpress就会把我带到主页/首页。我的自定义永久链接如下/%postname%-%post\u id%.html 但是如果我使用自定义的永久链接,比如/index.php/%postname%/或/index.php/archives/%post\u id%(包括index.php),它就可以工作了!但那不是我想要的 我尝试在lighttpd.conf上使用server.error-handler-404=“/index.php”,但仍然没有成功 任何帮助都将不胜感激。 谢谢 尝试使用Wordpress 带有Lighttpd和PHP-FPM的永久链接,wordpress,lighttpd,permalinks,php,Wordpress,Lighttpd,Permalinks,Php,我在服务器安装中使用Lighttpd,permalinks与PHP FastCGI配合得很好。但最近我用PHP-FPM更改了FastCGI,我的自定义永久链接不再工作 每次我点击一个帖子/页面,wordpress就会把我带到主页/首页。我的自定义永久链接如下/%postname%-%post\u id%.html 但是如果我使用自定义的永久链接,比如/index.php/%postname%/或/index.php/archives/%post\u id%(包括index.php),它就可以工作
url.rewrite-once=(“^/(.+)$”=>“/index.php/$1”)
不知道您是否需要一个特殊的结构,或者wordpress是否能够确定使用该结构查看哪些内容。
关于错误处理程序:在CGI应用程序返回404之前,它不会触发。根据您的描述,wordpress在发送404错误之前更倾向于重定向。这就是它不起作用的原因:是的,你是对的,我必须使用mod rewrite。我的重写规则如下:
$HTTP["host"] =~ "(^|\.)domain\.com$" {
url.rewrite-once = (
# Exclude additional specific directories from rewrites
"^/(files)/?(.*)" => "$0",
"^/(mysql)/?(.*)" => "$0",
"^/(wp-.+).*/?" => "$0",
"^/(favicon.ico)" => "$0",
"^/(sitemap.xml)" => "$0",
"^/(xmlrpc.php)" => "$0",
"^/keyword/([A-Za-z_0-9-])/?$" => "index.php?keyword=$1",
"^/(.+)/?$" => "index.php/$1"
)
}
现在它工作得很好。谢谢