product/([0-9]+)?$
translates to product/
followed by any number or nothing (and nothing more, not even a trailing slash). This doesn’t sound like the thing you want to achieve.
Instead, try the following
function wpse33551_rewrites_init(){
add_rewrite_rule(
'^([^/]+)/([0-9]+)/?$',
'index.php?post_type=artikelen&p=$matches[2]',
'top'
);
}
which translates to:
^
start of the string (ie, there is nothing else in front)([^/]+)
: at least one character that is not/
/
: a slash([0-9]+)
: at least one number/?
: zero or one (trailing) slash$
: end of the string
Related Posts:
- How to display posts in hyperlink with nested slugs?
- Force a specific template based on the URL
- Multisite theme path rewrite using .htaccess
- Configuring static page with add_rewrite_rule gives 404 after navigating to Permalinks admin panel
- Need help with add_rewrite_rule
- Custom post type permalink endpoint
- How Do I Programmatically Force Custom Permalinks with My Theme?
- Adding meta values to permalink
- Removing taxonomy base using WP rewrite
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Permalinks so that one custom post type appears to be a child of another, not working
- Custom taxonomy on permalink
- Prepend meta_value to permalink of post
- Using two permalinks for one post
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Rewrite url / permalink for default archive – yearly / monthly
- Permalinks, Rewrites, Get Variables, Oh My!
- Change permalink for a single post entry
- Custom Permalink Tag breaks Pagination
- Add parent/child taxonomy to custom post type url
- rewrite_rule for custom post type doesn’t affect get_permalink
- Add ‘articles’ prefix before blog posts url without affecting pagination
- custom permalink/shortlink with base62 encoded post ID
- Custom Permalink for Taxonimie and Custom Post Type
- Add specific word to default page permalink
- When is it a good idea to build a permalink structure from scratch?
- WordPress not respecting template hierarchy (fetches index.php instead of single.php or page.php)
- Link won’t show using the_permalink();
- get_query_var() and permalinks
- Call to a member function add_rule() on a non-object
- Why doesn’t flush_rewrite_rules run on plugin activation?
- I need a custom permalink for my website
- Permalink Structure CPT With Custom Taxonomy Fails
- Permalinks: Page Not Found
- Why is add_rewrite_endpoint incompatible with /%category%/%postname%/ permalink structure?
- Re-write specific custom post type category URL to go to another page
- Making a custom help center page
- Remove custom taxonomy base from URL
- add_rewrite_rule not working for me
- Using WP Rewrite, but just not “getting it”
- Share same Slug for a Custom Post Type and 2 Taxonomies
- How can I use get_post_meta with add_rewrite_rule to build custom permalinks?
- rewrite URL based on selected taxonomy for post page
- Can’t get custom rewrite tag, query var, permastruct (permalink structure), and rewrite rule to work properly together
- WordPress Persistent connection rule does not work for “posts”
- Customize Custom Post Type URL
- Rewrite CPT permalinks and include WPML language
- Custom Permalinks with CPT and Hierarchical Taxonomies
- Rewrite rule intended for CPTs gives 404 for pages
- Permalink structure between 2 custom post types and a taxonomy
- how to change permalinks format for pagination?
- Create custom permalinks to show Custom Post Type’s relationship?
- Permalink structure with custom taxonomies and custom post type like /parent-tax/child-tax/custom-post-type-name (with no base name)
- Rewrite Rules returning wrong data
- Filter categories used with Custom Structure Permalink
- Pretty URLs and custom post types
- How to make permalinks update from code?
- Permalinks only for posts
- add_rewrite_rule behaving strangely
- Default Permalink Type to Postname
- Custom rewrite rule ignored
- How to set a page as homepage in stead of the newspages?
- How to change url for taxonomy pages?
- wordpress 404 not found after rewrtie the author link
- Issue On Displaying Pages with Post Name Permalink
- Set parent for custom post type archive rewrite url
- Adding URL prefix for foreign language support
- add_rewrite_rule – Page Slug from “/foo-bar/” to “/foo/bar/”
- WordPress custom permalink and archive link for custom post type
- How can I set up a secondary permalink structure?
- How to Use metada Value in Url and is it possible? [duplicate]
- If I remove Category base from my URLs, how difficult will rollback be?
- Safest way to create a custom permalink
- Custom WooCommerce rewrite rules with comma delimiter
- rewrite based slug standar post wp
- Create different permalinks for same post
- remove SLASH on single_post but KEEP on categories and parent pages
- Getting post URL within custom content template
- How do I get the correct URL?
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Redirect page to homepage, keeping URL
- Add slug to default post permalinks ONLY
- How to add rewrite rule for product compare page?
- Remove “category” from permalink with add_rewrite_rule
- how to have same rewrite rules for 2 different post type?
- Permalink structure /page/page/cpt-post gives 404 with pagination
- What permastrusture tags are generated out of the box right after creating custom post types and taxonomies?
- Rewrite posts url as they’re all children of a page
- a way to support totally different url structure
- Multiple Permalink Patterns for one page
- Pretty Filter URL
- Prevent guessing slug
- WordPress permalink still not working (error or not understood?)
- Mamp pro permalink issues. Pages keep reverting to index.php
- Custom post type permalink structure
- Permalinks problem with custom theme
- WordPress add parameters with friendly url structure
- Add additional URL variations for a Post