You don’t have to mess with .htaccess since WordPress has it’s own rewrite engine builti in. You are looking for this: https://codex.wordpress.org/Rewrite_API/add_rewrite_rule
Related Posts:
- CPT archive 404ing when using a custom taxonomy name as a variable
- Is there a link parameter that will show me all my published pages?
- How to construct a dynamic rewrite rule for child pages that passes more than one query var
- append current user-id to all internal permalinks
- Strange permalink issue: can’t rename /company-2/ to /company/
- How to get permalink and title from post ID?
- Using $_GET variables in the URL?
- Removing leading zeros from custom permalink structure
- How do I turn off 301 redirecting posts (not canonical)?
- How can I include a query string with get_permalink
- Post being redirected to attachment post
- Without index.php in permalinks I get 404 across site
- Changing Permalinks to a Custom Permalink causes a 404 Error [no matter what I do]
- %tag% in permalink not working
- How to assign a Permalink to a Function
- How to get blog id from permalink?
- Mass Permalink Changer
- Using WP rather than .htaccess to redirect pages/posts
- How can you receive the most recent permalink or terms of the newly saved post?
- Dashes instead of slashes as permalink structure separator
- What happens when permalink settings are updated?
- custom permalink/shortlink with base62 encoded post ID
- query_vars in plugin not working?
- echo post-permalink without http and www
- How to get permalink in foreach loop
- CPT Post Title Permalink: Replace “@” (or all special characters) with dash “-” instead of just removing
- Disable permalinks on all pages and posts
- Custom add_rewrite_rule & permalinks
- Custom permalink for search and pagination
- Rewrite Rule for default post type
- WordPress permalinks that end with a hyphen result in a 404
- get permalink of page children in loop
- Confusing about permalink
- List / Get post redirects
- Programmatically Restrict WordPress from using certain URLs or sub-directories
- Title attributes on Permalinks for posts and products
- Permalinks problem – Category pages don’t work
- How to include sub directory in sitemap? [closed]
- Post preview gives 404 when permalinks are purely date based
- Custom $_GET vars in wordpress entry with permalink
- WordPress Not Using Template Files After Permalink Update
- Permalinks only for posts
- rewrite rule to redirect to the most recent date permalink
- File access different with permalinks on and off
- mod-rewrite exception? keep #hash in matching urls?
- How to link the title adding a permalink?
- Visiting posts results in 404 errors after host migration
- Suddenly new posts have the default permalink instead of the post name
- Permalink Settings
- get_posts post title permalink not working for last item in array
- rename ‘page’ URL fragment in pretty permalinks
- Can’t get permalinks working!
- WordPress not generating .htaccess but tells me that (Permalink structure updated.)
- Permalink with anchor on home page to single page
- Add category into post permalink
- Add post overwriting permalink from previous post in 4.6
- How do I keep multiple domain for my wordpress site
- Custom permalink structure with %postname% in front of domain name
- What is the right way to clean up $title before wp_insert_post?
- Create custom links for excerpts with php dynamically
- placing the media uploads in a subdirectory
- Permalink Structure not updating .htaccess
- Multiple sites with pretty permalinks with nginx
- mod-rewrite rules grabs “broken permalinks”, too
- Custom child page permalink
- How to allow slash(/) on page url
- Creating an alternate path for a page
- Permalinks causing wp-json to 405
- Parent/Child Categories Permalinks
- How to change URL from /%postname%/ to custom-name/%category%/%year%/%monthnum%/%day%/%postname%/
- How to prevent wordpress from lowering Capitalized letters
- An excluded ‘ghost’ page is crashing my permalink
- WordPress Multisite ABSPATH and get_home_path() to check for htaccess or web.config file
- Disable -2 Permalink Addition
- Permalink in relation with the files
- Every sub page shows Error 404, i have check permalink but still same issues
- Permalink structure /page/page/cpt-post gives 404 with pagination
- Changing permalink structure for Posts
- Allowing slash in slug/permalinks
- Custom Permlinks work, regular page permalinks don’t
- Author permalink
- Multiple Permalink Patterns for one page
- When is a good time to reset permalinks?
- WordPress permalink issue on AWS
- Permalink for Author’s Posts in a Category
- Search and replace post URL’s on page output?
- Two urls for one website
- WordPress Pagination Not Working After Transfer from Localhost
- Accidentally changed the permalink structure
- Why doesn’t WP update my .htaccess file?
- How is a URL getting mapped to a page template
- customize urls displayed by previous_post_link and next_post_link
- What is the issue with our links? It creates a loop
- Routing ‘fake’ sub sub posts
- Page and post auto links
- how to make follow?
- Permalinks Won’t Work
- Custom Permalink Structure For a Specific Category
- Error: “Sorry, this content could not be embedded” when using the Embed block
- WordPress not remembering old slugs for pages