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
- Get the blog page URL set in Options
- remove “index.php” from permalinks
- How to set permalink structure via functions.php
- Custom rewrite rules for archive page and single post
- WordPress Rewrite Rules for Custom Post Type and Taxonomy
- Custom post type permalink endpoint
- Multiple post types – share same ReWrite slug?
- Different ways to display title
- How to add a custom URL placeholder to author archives?
- How Do I Programmatically Force Custom Permalinks with My Theme?
- How to modify URL structures in custom post types and taxonomies or terms
- Adding meta values to permalink
- Removing taxonomy base using WP rewrite
- URL Rewrite + Page + Custom Post Type = Unusual Redirect
- Make post slug have priority over category slug
- Permalinks so that one custom post type appears to be a child of another, not working
- Custom taxonomy on permalink
- Permalink rewrite with custom post type and custom taxonomy
- Prepend meta_value to permalink of post
- wp_insert_post breaks rewrite rules
- Using two permalinks for one post
- flexible rewrite ‘ramble’ URLs with WordPress
- Permalinks for CPT breaks permalinks to pages
- WP Rewrite Rules – Custom post type & taxonomy
- Remove base slug in CPT & CT, use CT in permalink
- Change the custom post type permalink
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- Rewrite url / permalink for default archive – yearly / monthly
- WordPress Rewrite rule for nested post types
- Cache Busting using htaccess Rewrite rule?
- Permalinks, Rewrites, Get Variables, Oh My!
- Change permalink for a single post entry
- How to Modify Existing Rewrite Rules?
- 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
- How to set up Author archives with sub category URL
- 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
- How does WP handle multiple matching rewrite rules?
- Making a custom help center page
- Remove custom taxonomy base from URL
- remove sub-category of Custom Post Type from permalink structure
- WordPress add_rewrite_rule() cannot visit lower url levels
- add_rewrite_rule not working for me
- Is a permastruct possible on pages?
- Using WP Rewrite, but just not “getting it”
- Rewrite rule for a query string
- How to change custom post type permalink structure
- Custom permalinks with hierarchical taxonomy – getting PHP warning
- 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
- How can achieve this permalink perfectly? domain.com/%category%/%post-name%
- How to remove specific category from URL in WordPress
- Changes in permalink structure in WordPress and how to apply to in-site links
- 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
- Custom permalink leads to index page
- 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 how to replace url /bar with foo/bar for custom post type
- wordpress 404 not found after rewrtie the author link
- Issue On Displaying Pages with Post Name Permalink
- Issue on Getting Custom post type Thumbnail’s URL
- WordPress page/blog incorporated into static website