Same as title, i want visit link:
mysite.domain/hello-word
mysite.domain/my_slug/hello-word
is same link, look like WPML:
mysite.domain/hello-word
mysite.domain/en/hello-word
I try:
function custom_rewrite_tag() {
add_rewrite_rule('^([^/]*)/?/([^/]*)/?', 'index.phptheme_var=$matches[0]&pagename=$matches[1]', 'top');
add_rewrite_tag('%theme_var%', '([^&]+)');
}
add_action('init', 'custom_rewrite_tag', 10, 0);
but not working, somebody can help me?
Do you forgot question sign?
Between index.php and theme_var