[英]htaccess rules before wordpress own rules
I'm trying to add some rewrite rules to a Wordpress site, to go a little further than wp's own rewrite capabilities, but i am having trouble when I place those rules BEFORE wordpress own rules: if my rule rewrites to something that wordpress will rewrite later, it doesn't work. 我正在尝试向Wordpress网站添加一些重写规则,以使其比wp自身的重写功能更进一步,但是当我将这些规则放置在wordpress自己的规则之前时,我遇到了麻烦:如果我的规则重写为wordpress会重写的内容后来,它不起作用。 Eg:
例如:
www.domain.com/hello -> www.domain.com/image.jpg : this works, as wordpress doesn't interfere www.domain.com/hello -> www.domain.com/category/1 : doesn't work, even if www.domain.com/category/1 works by itself www.domain.com/hello-> www.domain.com/image.jpg:此功能有效,因为wordpress不会干扰www.domain.com/hello-> www.domain.com/category/1:不会即使www.domain.com/category/1本身也可以工作
I've tried to remove the L tag from my rewrite rules, to allow further rewriting, but it doesn't seem to work...maybe wordpress does starnge things with htaccess? 我试图从我的重写规则中删除L标签,以允许进一步重写,但它似乎不起作用...也许wordpress会用htaccess引起麻烦吗?
Does this sound familiar to anyone? 这听起来对任何人都熟悉吗?
Thank you 谢谢
Wordpress doesn't check the rewritten url ( /category/1
), but parses the original request url ( /hello
), and so it doesn't know what to do with /hello
. WordPress不会检查重写的URL(
/category/1
),但是会解析原始请求的URL( /hello
),因此它不知道如何处理/hello
。 To fix this use the proxy flag. 要解决此问题,请使用proxy标志。 So
[L]
would become [L,P]
所以
[L]
会变成[L,P]
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.