I am trying to create the SEO friendly URL: http:///foto/linse2-at/linse2-at-schloss-altenhof/2618
for this one: http:///?fotograf=linse2-at?gallery=linse2-at-schloss-altenhof&img=2618
For my logic, this code should work:
add_rewrite_rule(
"foto/([^/]+)/([^/]+)/?([0-9]{1,})/?",
"index.php?fotograf=$matches[1]&gallery=$matches[2]&img=$matches[2]",
"top");
But the the rule generated is (dump of global $wp_rewrite):
[foto/([^/]+)/([^/]+)/?([0-9]{1,})/?] => index.php?fotograf=&gallery=&img=
..which does not work.
It seems that the "$matches[1]" are missing.
Thanks for your input!
fotograf
,gallery
, andimg
? Are those registered query vars? Rewrite rules have to result in a successful main query that loads some type of WordPress object- a page, a post, an archive.