I am using Wordpress rewrite rules and I want to have a URL like this:
http://my-app.com/data-library/brand_name
Here is my code:
function my_add_rewrite_rules() {
add_rewrite_rule(
'^data-library/([^/]*)/?',
'index.php?pagename=data-library&brand_name=$matches[1]'
);
//flush_rewrite_rules();
}
add_action('init', 'my_add_rewrite_rules')
I also use flush rewrite rules and save permalink but still a 404 Page not found error
Need help
Thanks
You need to apply with this modified code
Please reset permalinks because htaccess file updated after saving permalinks