I'm having basically the same problem as question #44117. I have a custom rewrite rule set using add_rewrite_rule, but when the user goes to the page, the entered url changes and the value is lost.
User enters: membership/member-profile/profile-name/
And is forwarded to: membership/member-profile/
Here's my rewrite code:
function profile_rewrite() {
add_rewrite_rule('membership/member-profile/([^/]+)/?', 'index.php?pagename=member-profile&profile=$matches[1]', 'top');
}
add_action('init', 'profile_rewrite');
I've been researching for hours, and while I've found others with a similar problem, there has never been a definite solution.
Maybe it's a problem with my Wordpress settings? If I enter the URL:
index.php?pagename=member-profile&profile=test
I'm forwarded to:
membership/member-profile/?pagename=member-profile&profile=test
Which returns a 404 error.
Thanks in advance for any help. I'm pretty new to this Wordpress stuff and maybe I'm jumping in a bit too quickly.