I got it
function rewrite_profile() {
add_rewrite_rule('^profile/([0-9]+)/?', 'profile/?id=$matches[1]', 'bottom');
}
add_action('init', 'rewrite_profile');
I still don’t know if this is the right way.
Related Posts:
- How can I modify the permalink via a filter?
- Newbie question: no index.php? in my plain wordpress permalink
- Change links automatically to affiliate links
- Rewrite sub folder dynamically with country code in WordPress using PHP
- Use WordPress’ URL rewrite engine
- Rename “Portfolio” slug?
- How to rewrite URL with PHP variables with htaccess to a normal looking URL?
- Static variable and add_rewrite_rule?
- Nesting if statements to echo only one string based on what tag was filtered?
- How to change home or site url using action hooks or filter?
- Why do WordPress rewriites seem to work differently for posts vs pages?
- Performance impact of rewriting WordPress URLs
- Is sanitize_title_with_dashes formatting function too liberal (in terms of accepted characters)?
- Changes in permalink structure in WordPress and how to apply to in-site links
- WordPress Persistent connection rule does not work for “posts”
- Append query string to all URL’s
- custom rewrite rule help! Custom rewrite rules not applying to custom post type
- subdirectory index.php is not working
- Use URL Rewrite as well as $_GET parameters in URL?
- How to modify URL (add GET values) after front end form submission?
- parts of url disappear when using # inside href=”” [closed]
- Create custom permalinks to show Custom Post Type’s relationship?
- Add .htm extention to a custom taxonomy
- Help with .htaccess and Login with Subfolders
- WordPress add_rewrite_rules for custom URLs ending in .html
- Rewrite with pagination /foo/page/2/ to posts of a given category, page 2
- Divi change project category slug
- How to add a rewrite endpoint to unattached media?
- How do i add slugs to a URL, but still redirecting to the same page
- Nginx WordPress and another Web app URL structure
- Custom post type url Rewrite (conflicting with page url)
- WordPress Rewrite Rule
- Why is home page content not displaying with this rewrite rule?
- Modifying WP URL handing code?
- How to deal with a GET variable of ‘name’?
- How to define a rule in functions.php that ONLY disables the default wp functionality that undesirably changes ‘&’ to ‘#038;’?
- How to pass username in affiliate link in wordpress website
- Test the existence of a page/article by its URL, taking in consideration the URL rewriting by filters
- url not using query string no longer working
- Current WordPress Page Title as Search Parameter into A Tag
- How does one make a URL return dynamic JSON with custom Content Type?
- URL rewrite rule
- How does WordPress rewrite URLS using its PHP scripts
- WordPress Rewrite Issue
- How to print redirected query string variables to the page?
- Multiple URL from Custom post name
- Why isn’t my custom function kicking in from my functions.php file?
- Difference in Get Variable Location
- WordPress adding in site URL to header links
- Dynamically append custom post type to end of url
- WordPress add parameters with friendly url structure
- Custom taxonomy with page post type – WordPress
- Remove slug of multiple custom post types with and without hierarchical
- Alternative to php echo within code
- Add multiple HTML attributes to an Elementor button
- Customize the summary table of an order in the email
- Query posts by custom taxonomy slug in WP REST API?
- oneOf JSON Schema validation not properly working for custom post meta value?
- How to add Paragraph Tags in WordPress using Visual Composer?
- PHP – Multiple variables in insert post array
- advanced custom fields: repeater field within conditional statement [closed]
- Why does WordPress not send the user the email to add a password?
- How to put a class in the p tag automatically added by the_content() in the wordpress loop?
- How to sort custom sortable column by custom table value
- How to disable page create for custom post type, but allow a page with the post types slug to be created?
- WooCommerce Modal Fly cart on add to cart – With AJAX
- /page/2/ redirect to 404
- How can I trim /page/ URL with PHP in WordPress
- Adding date and time to the same request
- Search custom post type posts only by meta fields?
- running an existing WordPress site from Visual Studio Code?
- get_post_meta returns on side but it doesn’t return on bottom of admin page
- “Unexpected response from server” error when trying to upload any .mp4 file over 100MB
- Calling a function via a shortcode in javascript
- Manipulating the allowed inner blocks of a core-gutenberg-block?
- Get a list of folders inside uploads directory
- How to show correct td of table tags in wp_query loop
- require used as a function to load theme dependencies?
- Adding code before any page loads
- fetch from an external api call and display results in page
- If user is Admin or another role
- Using WooCommerce Hooks to add product attribute descriptions to customer order email
- Duplicated WP Multisite for testing environment is redirecting to production site
- Display posts based on the selected category when no subcategory is chosen
- Remove datePublished and dateModified from Yoast Schema output on WordPress website
- Translate string in another langage than Locale
- Access wordpress blog on subdirectory /blog that is running on subdomain
- Running WP-Cron on Multisite networks the right way?
- Programmatically convert single classic block to individual blocks via PHP
- How can I cause run wp-cron to trigger sequentially?
- Get generated block styles programmatically
- How could I prevent using the same custom loop in a template file when I only need to change one meta_query parameter?
- Automatically populating a date parameter within a shortcode
- How to get the content of a dynamic block in PHP
- Custom rest fields not loaded in rest api cpt response
- WordPress and php 8.1
- WordPress query_posts with multiple tax_query
- Inserting more than one array into same row
- How to inject right sidebar on post edit page?
- Filtering with Attributes – how to display all non-queried products below query