简体   繁体   中英

Wordpress rewrite rule not working?

I am trying to implement some rewrite rules on a wordpress website to rewrite my urls like:

glossary/?terms=a

to

glossary/terms/a

I have added the following code to my functions.php and have flushed the rewrites but havent had no luck?

add_rewrite_rule('^glossary/([0-9]+)/?', 'glossary/?terms=$matches[1]', 'top');

Can anyone point me in the right direction or advise what is incorrect with the above?

设法使它与以下重写规则一起使用:

add_rewrite_rule('^glossary/term/([a-z]+)/page/([0-9]+)/?$', 'index.php?post_type=glossary&terms=$matches[1]&paged=$matches[2]', 'top');

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