The most efficient way to accomplish this would be to change the structure to /%postname%/
and add a 301 redirect to your .htaccess file for the old structure:
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$3
Change example.com
to your domain and add the redirect above the # BEGIN WordPress
directive so it won’t be removed if WordPress updates the file.
EDIT- redirect /yyyy/mm/dd/postname
RedirectMatch 301 ^/([0-9]{4})/([0-9]{2})/([0-9]{2})/(?!page/)(.+)$ http://example.com/$4
Related Posts:
- Use subdomain for certain urls
- Using WordPress with Apache behind an nginx reverse proxy
- How to redirect http://mydomain/blog/blahblah/ to http://mydomain/blahblah/ in wordpress htaccess?
- Change pagination url format
- How to redirect specific URL to Subdomain
- How to redirect a link to a new link?
- Can’t get pretty permalinks to work without index.php
- WP-Include rewrite directory
- openlitespeed rewrite rules conversion from apache
- How to automatically redirect HTTP to HTTPS on Apache servers?
- What is Options +FollowSymLinks?
- htaccess – Redirect to subfolder without changing browser URL
- PHP and mod_fcgid: ap_pass_brigade failed in handle_request_ipc function
- Apache server keeps crashing, “caught SIGTERM, shutting down”
- httpd: Could not reliably determine the server’s fully qualified domain name, using 127.0.0.1 for ServerName
- Configuring Apache for localhost
- How to create custom URL routes?
- How do you create a “virtual” page in WordPress
- How to create a front end user profile with a friendly permalink
- Use a template file for a specific url without creating a page
- Using the Rewrite API to Construct a RESTful URL
- Does WordPress keep track of a post’s URL history and provide automatic redirects?
- Change the “page” slug in pagination
- Understanding add_rewrite_rule
- Override default url for author pages?
- How does one suppress a 404 status code in a WordPress page?
- web.config conflict on IIS
- Rewrite Slug for CPT Archive Pages to Plural Name of Slug
- Change author base slug for different roles
- Masking wp-content/themes/name/images to just images directory using htaccess
- Two (or more) parallel (sub-)TLDs that are retained when surfing the site / dynamically set the site address?
- Using custom/dynamic “slug” for a page
- How to make pages slug have priority over any other taxonomies like custom-post, post or category
- Rewrite rules not working in WordPress
- How to retrieve $_GET variables from rewritten URLs?
- Dynamic Endpoints
- Passing parameters to a custom page template using clean urls
- rewrite rules and querystring
- Adding rewrite endpoint breaks static front page
- How to add custom rewrite rule to .htaccess?
- How do I remove a rewrite rule?
- How do I add a server-independent external rewrite rule?
- Multiple endpoints to same page
- Problem with add_rewrite_rule and pagination (paged and page query_vars)
- Custom Permalinks for Blog Posts Only
- Unique URL Every Time
- generate_rewrite_rules (action) vs add_rewrite_rule (function): which one is preferred?
- Detect page type by url (Archive, single, page, author,…)
- Rewrite URL – how to do a SEO-friendly Unicode custom URL?
- I want to create a custom slug in WordPress and output JSON. How do I do this?
- How to make a category page the blog home page?
- add_rewrite_rule: $matches var not replaced by captured value
- Can I call a custom plugin with a direct URL
- How to show the same content on multiple URLs?
- Custom slug in front of search URL
- Display posts with author in the url with custom post types
- Custom rewrite rules for pages
- Rewrite default post type
- Custom permalinks with NextGEN Gallery
- Clash of the rewrites
- Using a page template without a page
- External/non-WP rewrite rules
- How-to add rewrite rules to point the uploads folder to a subdomain
- Rewrite Rules for Multiple (more than 2) Taxonomies
- Create built-in pages without creating actual pages
- How to seamlessly redirect between different archive and singular slugs?
- Is the SEO plugin necessary?
- Can ‘numberposts’ be passed in the URL query string?
- How to add dot(“.”) in post slug
- How to prevent redirection to max 2147483647 for larger values of the page query variable?
- add_rewrite_rule not loading correct page nor getting variables
- Overwrite rewrite-slug of built in post-type ‘post’
- Preserving $_GET parameter while using custom Rewrite Rule
- How to change default page slug?
- Query Vars for the Homepage?
- Disable wordpress pagination URL rewrite for specific page
- How to use Post Custom Metadata in Post Titles and Post Permalinks
- How can I make WordPress work with a Symfony app?
- Handle category name URL rewrite before different post type slugs
- Using plus (+) sign instead of space (-) in WordPress URL
- Rewrite url for custom post type
- How do i change the search permanent links
- add_query_vars and add_rewrite_rules
- How to remove “admin.php?page=” from wp-admin using .htaccess?
- Why is group ownership with rwx permissions not enough?
- add_rewrite_rule() not playing nice with child pages
- WordPress URLs without posts
- rewrite_rule() not preserving the query string
- Need help with rewrite_rules_array
- Add language/country code to each possible URL
- Google is indexing wordpress attachment pages
- How to create the pseudo static rules of the page I created
- Changing directory and/or URL structure
- SEO Friendly URLs for my plugin categories
- Will references to ugly links automatically redirect to their pretty url permalink?
- How do I add a add_rewrite_rule without it redirecting?
- How to create a specific frontend URL (not a Page) from a theme or plugin?
- Taxonomy rewrite question
- Mod_rewrite delete parameter in 301 Redirect
- add_rewrite_rule not working for page var