thanks for you reply,
So after much digging, it’s working :
function myplugin_rewrite_tag_rule() {
add_rewrite_tag( '%symbol%', '([a-zA-Z0-9_]+)' );
add_rewrite_rule( '^crypto-monnaies/([a-zA-Z0-9_]+)/?$', 'index.php?
pagename=showcoin&symbol=$matches[1]','top' );
}
add_action('init', 'myplugin_rewrite_tag_rule');
function add_query_vars( $query_vars ) {
$query_vars[] = 'symbol';
return $query_vars;
}
add_filter( 'query_vars', 'add_query_vars' );
Please note that if you dynamic page is a second level page, you have to call the ?pagename=parent-page/child-page (with the slash).
To resolve my problem i put the “showcoin” page to first level.
Related Posts:
- How to add custom rewrite rule to .htaccess?
- SEO Friendly URLs for my plugin categories
- Custom rewrite rules are sending everything to index.php
- WordPress keeps writing rewrite rules to .htaccess
- WordPress Rewrite
- Dynamic URL, not a physical page within the database
- Custom rewrite rule
- hard flush_rewrite_rules() not regenerating .htaccess
- Map alt domain to specific section of website w/o MU
- Rewrite rule to load images from production does nothing
- WordPress rewrite rules don’t need ^?
- My WP_options db rewrite_rules Does Not Work
- Disable Pagination on Pages
- .htaccess rewrite
- Changed pagination URLS to use p= instead of paged=
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- WordPress keeps writing rewrite rules to .htaccess
- Customise particular RSS permalink
- RSS feed rewrite matching wrong rule
- Rewrite specific action url
- How do I make WordPress revise an .htaccess file a certain way?
- Rewrite rule that wp-login.php?action=register is left alone
- Pretty URL via Rewrite
- Migration from old CMS to WordPress 301 redirection rules?
- Additional .htaccess rules based on wp page
- What is the proper way to use add_rewrite_rule to remove the (question mark)?
- Can’t get pretty permalinks to work without index.php
- Rewrite Page Parameters
- WP-Include rewrite directory
- How do you create a “virtual” page in WordPress
- Rewrite rules not working in WordPress
- Preserving $_GET parameter while using custom Rewrite Rule
- Taxonomy rewrite question
- How do I remove a word from a url in WordPress using .htaccess?
- Rewrite rules in .htaccess get overwritten?
- Getting add_rewrite_rule and add_rewrite_tag to work
- Rewrite Rule for Custom Page with Query Vars in URL
- WP Rewrite the last two parts of the URL
- Prevent WordPress from automatically correcting URLs
- WordPress redirection to get url friendly
- Nginx rewrite rule conflict with WordPress permalinks rule
- Access $_POST data after redirect
- Change Query String to pretty permalink
- External/non-WP rewrite rule without QSA
- How to add a custom redirect rule for subdomains?
- Remove special characters in a URL
- How to do Basic URL Rewrite Without Redirecting
- URL Rewrite doesn’t work for nested pages
- Alias ‘wp-content’ directory to something shorter (framework?)
- url rewrite parsing a custom url parameter not working
- How to add custom variable in url without redirect?
- Using category slug in add_rewrite rule
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- add_rewrite_rule ignoring other params than the “p” param
- How to catch Rewrite rules then display a specific post?
- Adding two rewrite rules
- Load an url with minimal/no DB queries
- Auto generate rewrite rules for multiple taxonomies
- Change htaccess to redirect to index.php in subfolder
- Cannot access wp-admin without trailing slash – .htaccess configuration for WordPress behind a nginx proxy
- Wildcard forward all posts and pages with few exceptions
- Help with Rewrite Rule for Custom Post Type with Query String
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- URL Rewriting for PHP script on an image URL
- Create Dynamic SEO Friendly URL for Virtual Page
- add_rewrite_rule with query variables
- Replace specific middle part of url
- Rewrite query string to path
- Rewrite API -Adding a parameter before the slug
- Rewriting a subdomain page on one WordPress installation to a parent domain on another
- Help with rewrite rules for two post types
- Rewrites rules disappear after a while
- Rewrite vs Redirect from ?p={ID}
- Adding a rewrite rule to page that has no fixed variables and pagination
- Flush rewrite rules on option update with Settings API
- Having WordPress control only certain pages with .htaccess?
- Localize URL bases
- Help with a custom rewrite
- Using URL rewrite to add custom URL for custom post type
- WordPress simple Url Rewrite
- 301 Rewriting htaccess
- Proper way to set up rewrite with Wp
- Why is a rewrite rule in wordpress prevent pagination?
- Rewrite custom taxonomy slug – but only parent items
- Exclude subfolder in WordPress permalink
- wordpress path generation from rewrite rule
- Rewrite WordPress Url from root to subfolder without moving files
- WordPress pagination broken for page 2,3 with custom permalink. Redirects to baseurl
- Help with .htaccess setup to hide WordPress Directory
- Ugly URLs when there’s pagination
- How do I rewrite URL that has custom parameter
- Why is there a 404 on page 2+ for my search page?
- Rewrite rule for post as a child of a CPT
- URL Rewrite and Archive Template Files – Post Type vs. Taxonomy
- .htaccess RewriteBase equivalent for WordPress – Passing a URL as a variable without getting a 404
- Change Admin URL
- URL Rewrite for CPT single posts
- Using add_rewrite_tag to create urls for page sections
- Rewriting WordPress URLs
- How to rename the WordPress wp-login.php running on IIS6?