You don’t need a URL rewrite. WP will show the single work post by default using the single-work.php
template.
Go to Settings > Permalinks
and select Custom Structure
there. Put this rule in the text input:
/%post_id%/%postname%
And save the settings.
This should work for you.
Related Posts:
- Why does wordpress still strip my query var?
- Tricky URL rewrite with custom values in url
- Add a query string to ALL links on site
- Add rewrite rule for rewrite endpoint
- add_rewrite_rule not working for language specific characters
- How to add custom variable in url without redirect?
- How to building pretty URLs to reflect category hierarchy?
- Rewrite custom post type URL parameters
- Help with Rewrite Rule for Custom Post Type with Query String
- Change pagination url format
- Per Page Permalink Structure for Page Post Type
- Rewrite /category/cars into /topics/cars
- custom wordpress rewrite
- How to use wp rewrite to hide form action url?
- Dynamic URL with rewrite rule not working
- How do I rewrite URL that has custom parameter
- Pagination appearing twice in URL after rewrite
- URL Rewrite for CPT single posts
- Rename page URL
- How to create custom URL routes?
- Using custom/dynamic “slug” for a page
- How do I remove a rewrite rule?
- Custom slug in front of search URL
- Display posts with author in the url with custom post types
- Clash of the rewrites
- Disable wordpress pagination URL rewrite for specific page
- How to use Post Custom Metadata in Post Titles and Post Permalinks
- rewrite_rule() not preserving the query string
- Will references to ugly links automatically redirect to their pretty url permalink?
- Appending numbers to url do not break the link
- Custom rewrite rules are sending everything to index.php
- WordPress Network on IIS7/SQL Server – Rewrite Issues
- Custom comments
- Custom rewrite rules for feeds of custom queries (query_var query strings in URL)?
- WordPress 404 unless there is a space in url
- redirect 301 old url to new url
- Migrating a page to be an article
- Having trouble with using add_rewrite_rule and pagination
- How to get “extended” path info from URL in a plugin
- Rewriting rules: difference between ‘init’, ‘rewrite_rules_array’, ‘generate_rewrite_rules’?
- Multiple Permalinks for Same Post
- How to perform a query at the URL?
- Is there a way to create alias without using htacess, permalinks or delving into code?
- Remove “/page/1” from the URL
- hard flush_rewrite_rules() not regenerating .htaccess
- Is there a ‘rake routes’ for wordpress?
- Rewriting URLs in WordPress
- Rewrite Rules Are Redirecting and Not Passing VARs
- WordPress rewrite rules don’t need ^?
- custom template rewrite
- add_rewrite_rule fro html to another url not working
- WordPress redirects non-existing url to existing ones – how to disable
- Disable Pagination on Pages
- How to rewrite url wordpress?
- How to add a custom redirect rule for Post as subdomains?
- How to preserve the query string while using add_rewrite_rule and default public query vars
- A clean custom rewrite rule for weekly archives
- I want to add a new tag to WordPress URL permastruct
- How to use add_rewrite_rule in subdomain
- QSA Rewrite Rule
- ReWrite rule for files of a previously standalone blog moved to network
- URL renaming issue
- Best way to trigger rewrite rules
- Trouble with question mark in rewrite rule
- Adding a query string to only one page url
- What URL rewriting rule should I write to retrieve a var in the URL?
- Weird characters behind every single link and images
- WordPress Rewrite rule is not working
- How do I make WordPress revise an .htaccess file a certain way?
- How to change an existing wordpress page rewrite rule?
- URL rewriting in wordpress using parameters
- Rewrite rules – page does not exist
- Custom route and extract data from slashes and parameter
- add_rewrite_rule with optional parameters
- Allowing multiple URLs for same Post
- How to create dynamic URLs on WordPress?
- Rewrite rule regex help required
- Redirect empty search to another page
- Rewrite Rules are Redirecting
- Using a template file for a specific custom URL
- Rewrite dynamic URLs as pretty URLs in WordPress functions.php (add_rewrite_rule) – what’s wrong with my code?
- Issue with custom rewrite for products and permalinks
- Prefix only some posts with a custom prefix
- Param causing 404
- How to use a capture from a rewrite rule inside a php file (like single.php)?
- url rewriting on custom post type
- Rewrite rule not redirecting correctly
- Remove Page Slug from URL
- I want to add one extra field to my URLs, I’m using Rewrite functions but it doesn’t work
- How to create short urls for sharing and downloadable content?
- Rewrite rule is not working
- Is it possible to rewrite a page url Without setting the permalinks to Post Name?
- How to stop WordPress creating URLs that don’t exist
- Post Type Rewrite Custom
- Additional .htaccess rules based on wp page
- URL Rewriting in WordPress
- Lost WordPress website access after changing URL [closed]
- Rewrite rule to simulate page hierarchy results in 404
- add_rewrite_rule not working with custom variables
- Standard Regex syntax doesn’t work in WordPress rewrite rule