简体   繁体   中英

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. 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

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?

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 . To fix this use the proxy flag. So [L] would become [L,P]

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM