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
- Display current category title on category page
- Is it possible to generate a page without create in the admin?
- Admin Media grid view images won’t load
- WordPress remove EXIF Data from specific Thumb
- How to redirect all 404 in a WordPress subdirectory to the index.php of subdirectory?
- When must I use and verify nonce?
- Filter get_the_title to remove certain characters?
- Displaying a button on each post
- How can I set a default category for a custom post type in wordpress?
- Store records for a table in wordpress
- Slider loading issue
- WooCommerce Related Products by Attribute
- Sort posts by custom fields value using dropdown menu
- Cause of Blank Lines Being Added to WP FIles?
- Limit Widgets to Sidebar ID’s
- Weird 404 URL Problem – domain name being placed at end of urls
- Trouble checking if custom woocommerce checkout field is empty or not
- Styling my own password protected page, how to deal with wrong password?
- WordPress Theme Modification Help
- PHP Warning: strip_tags() expects parameter 1 to be string?
- Where can I find the inline-css of my theme header?
- Remove empty terms from array, sort alphabetically, update back to repeating field
- custom plugin with upload files does not work
- page 1 is not paged
- How do I call an external php non WordPress class into functions.php?
- no_rest_route error on custom routes
- HTML Form Question
- Exclude ipads and tablets form wp_is_mobile code
- How to put the day of the function get_the_modified_date (‘l’, $post_id’) with the first capital letter?
- WordPress How do I pass a variable from one add_action to another?
- Advance custom fields variable with if statement & Function
- Printing OEmbed URL based on Post selected w/o page refresh
- How to use something like meta_query but for fields?
- Return only certain (html)-elements of the_content()
- Page returning ID from array, how to return the correct values for post in acf wordpress
- Can someone help me edit the code for limiting image dimensions
- WordPress site cant display media when it’s live
- Removing all my hardcoded URLs with get_site_url()
- Restricting Post Content Visibility with Custom Code – where to put it?
- Highlight main menu when on specific posts or pages
- wc_add_notice not working on cart page
- How to convert my comment.html to comment.php
- It’s not showing full content for posts pages in wordpress “[…]” while customing some changes in the style.css file [closed]
- How do I convert a custom field to a php date format? [closed]
- append special url end of my website urls
- How do I a custom search form by taxonomies?
- WordPress REST API – Custom field not added to pages
- Woocommerce – add tracking code to another email template