- Hook into
'404_template'. (Example) - Fetch all public custom post types where
has_archiveis notFALSE. - Find the post type’s
has_archivestring and see if it is part of the current request’s url. - Try
get_page_by_title()with the last part of the requests. wp_redirect()to the found post’s permalink.exit;.
Related Posts:
- Change the “page” slug in pagination
- Change author base slug for different roles
- Using custom/dynamic “slug” for a page
- Display posts with author in the url with custom post types
- How to add dot(“.”) in post slug
- How to change default page slug?
- Handle category name URL rewrite before different post type slugs
- How to change ?lang=cn into /cn/
- custom htaccess rewrite rule for page
- Why is there /index.php/ in all my links? How do I remove it?
- Multiple Permalinks for Same Post
- Adding more pages to author pages
- Using Blog Parent Slug on Blog Posts Only
- Load a template page based on part of slug in wordpress
- Removing “category” from URLs then “add_endpoint()” won’t work…
- How do I change attachment slug from name to id
- Access files at new location using old file paths
- Adding special characters to slug?
- Rewrite URLs – Custom Post Type – Post Slug, Taxonamy Slug
- Preserve old website URL structure after migrating to WordPress
- How to change the Author Slug from Username to Nickname and deal with Special Characters
- How to change custom post type slug
- Disable WordPress from changing URL slug when post is published
- Using URL rewrite to add custom URL for custom post type
- One off rewrite for single post-type slug (show normal page with same URL instead)
- Can’t use a specific custom URL (slug)?
- How to transform multiple parameter URL to clean URL
- Make the home page’s slug visible in the browser’s URL bar
- Trying to add array of paths to post permalink
- Changing the wordpress default search url to something like – …example.com/search?query=keyword
- How to add dot(“.”) in post slug
- WordPress is adding “category” word before my actual category name in url (and this is unsolicited)
- Change author base and slug in author link
- WordPress numeric (yearly) page names / disable yearly archives
- URL Rewrite and Archive Template Files – Post Type vs. Taxonomy
- Post & Page with same slug
- How to add 2 variable rewrite rule?
- taxonomy term in URL slug won’t forward to the correct term for custom post like it does for default categories/normal posts
- Custom Post type and Custom taxonomy with URL rewrite worked but template did not
- Remove Page Slug from URL
- Needed to change slug to access page
- Pagination posts. Url format
- URL rewrites af
- Change the slug ( url ) to a sequence number starting from 0 in the custom record type?
- Switch WordPress to non-absolute links? [closed]
- How to change the url of the archive page to be inside the custom post type
- How to create a front end user profile with a friendly permalink
- Masking wp-content/themes/name/images to just images directory using htaccess
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- How do I remove a rewrite rule?
- Use subdomain for certain urls
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- Can I call a custom plugin with a direct URL
- Custom slug in front of search URL
- Clash of the rewrites
- Can ‘numberposts’ be passed in the URL query string?
- Will references to ugly links automatically redirect to their pretty url permalink?
- Custom post type permalink structure with the category also acting as an archive
- Prepend meta_value to permalink of post
- Rewrite custom post type url’s adding meta box values
- Author url rewrite
- Tricky URL rewrite with custom values in url
- Search url wp-rewrite after redirect?
- Use the plus sign “+” instead of dash “-” in URLs
- redirect 301 old url to new url
- Add rewrite rule to call front-page.php?
- Add a query string to ALL links on site
- How make a multi language routes, with rewrite rules or rewrite endpoints?
- Add rewrite rule for rewrite endpoint
- Having trouble with using add_rewrite_rule and pagination
- Issue with using .htaccess to redirect feedburner feed
- How to create an endpoint without creating sub endpoints?
- Is there a ‘rake routes’ for wordpress?
- Rewriting URLs in WordPress
- ‘rewrite_rules_array’ or ‘generate_rewrite_rules’ for adding custom rewrite rules?
- WordPress Page Id
- Rename “Portfolio” slug?
- How to rewrite taxonomy and tags URL
- Changing WordPress Address URL disaster
- Prevent WordPress from Rewriting URL for one template
- Disable Pagination on Pages
- Rewriting a page with a custom parameter
- WordPress 3.9 breaks invalid permalinks.. code fix possible?
- Hide admin login without plugin
- Need help with simple rewrite rule (shouldn’t this be easy?)
- 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
- How do I display only the parent page in the url
- Trying to find the location of a rewrite of the URL query
- “View post” leads to odd URL
- Redirect HTTP to HTTPS for all sub domains (blog posts)
- Get url param no longer works when using add_rewrite_rule
- How to use add_rewrite_rule in subdomain
- How to create a URL Rewrite rule?
- Rewrite the default post object’s permalink
- How can I redirect product url to category then product url?
- Map secondary domain to other’s virtual subfolder
- adding custom controller called by front-end
- rewrite attachment url with attachment title
- WordPress search rewriting