php - Adding a rewrite rule to wordpress using regex
518
I'm trying to write a rewrute rule for wordpress:
add_rewrite_rule( '(.*)/([0-9]+)/?$', 'index.php?name=$matches[1]&p=$matches[2]','top' ); // check for not page in matches[1]
I want to add two more conditions in$matches[1]
i.e.(.*)
should not contain any/
and also should not contain the stringpage
.
To sum up, I want to match only strings like:
/abc/232
But not these:
/abc/sdsd/232
/page/232