Add rewrite rules doesn't work
-
Hi. I want rewrite an URL:
http://localhost/?post_type=cd&cd=cdname&singers=singername to http://localhost/cd/cdname-singernameSo I wrote this code:
add_rewrite_rule('cd/([^/]*)-([^/]*)$','index.php?post_type=cd&cd=$matches[1]&singers=$matches[2]','top');
But it doesn’t work.If I wrote:
^cd/([^/]*)/([^/]*)?
instead^cd/([^/]*)-([^/]*)?
( http://localhost/cd/cdname/singername instead http://localhost/cd/cdname-singername ) it works…How can I resolve? Thanks.
- The topic ‘Add rewrite rules doesn't work’ is closed to new replies.