Sooo the problem was my brackets around the content in the condition I think.
I’m still not so hot on these things, but I use these rules and they work:
RewriteCond %{REQUEST_URI} ^/(review|preview|feature).*\-[0-9]+$
RewriteRule ^review/(.*)\-[0-9]+$ /$1 [R=301,L]
RewriteRule ^preview/(.*)\-[0-9]+$ /$1 [R=301,L]
RewriteRule ^feature/(.*)\-[0-9]+$ /$1 [R=301,L]
note: the (review|preview|feature) but is an x OR y OR z, as I have the rule working for any of those folders specifically.
Related Posts:
- Redirect URL Containing åäö
- htaccess – Redirect to subfolder without changing browser URL
- Generic htaccess redirect www to non-www
- Making a plugin file accessible via url rewrite?
- How to change default page slug?
- Sub domain redirection to taxonomy
- Custom domain for sub-section of parent website
- Menu links only using http after enabling https, unable to redirect http links
- How to create a 301 redirect that doesn’t apply to subsites
- Why does multisite bypass WordPress for wp-content, wp-admin, wp-includes and .php files?
- mod_rewrite empties QUERY_STRING if starting with number [closed]
- .htaccess rule to redirect old URLs to new structure [closed]
- How to configure Multisite Network with randomized hostnames?
- How to remove wordpress directory slash
- Wrong Redirect/Rewrite Rules?
- Redirections and rewrites to subdomain
- How To Fix A Redirect Chain
- Image URLs not redirecting properly
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Changing wp login url without plugin
- WordPress .htaccess rewrite for custom template
- Why does WordPress redirect when I separate wp-core and wp-content?
- Some posts from custom post type to subdomains
- mod_rewriting conflict with WP permalinks in htaccess [closed]
- Redirect – remove custom query string
- WordPress and Htaccess
- What is the importance of mod_rewrite?
- 1 WordPress, 2 themes, 2 domains, 2 servers
- apache_mod_loaded setting can fubar plugins?
- Understanding Redirects
- How to stop rewrite from redirecting
- Block bad bots with mod_rewrite and save in blacklist
- Cannot get 301 redirection in htaccess to work (either Redirect or Rewrite)
- What is the best practice workflow for new website overhaul and keeping current SEO ranking? [closed]
- htaccess and redirect to new url using regex
- WordPress on a subfolder but accessible from root
- URL Redirect on GoDaddy platform [closed]
- Redirect, Change URLs or Redirect HTTP to HTTPS in Apache – Everything You Ever Wanted to Know About mod_rewrite Rules but Were Afraid to Ask
- How do I make a redirect in PHP?
- Nodejs – Redirect url
- Unable to login and wp-login.php redirects to wp-admin%2F&reauth=1?
- Redirect function inside a Shortcode
- Best Way to Redirect Category to Page and Hide Category
- Creating 301 Redirects for Post, Page, Category and Image URLs?
- “.#[random-char-string]” being inserted at end of URLs
- Index in root, wordpress in subdirectory
- How to change redirect after moving a page to trash?
- how to do logout redirect to current url
- Using WP rather than .htaccess to redirect pages/posts
- Logout and redirect using the WP Menu
- Plugin for conditional redirect
- Change the Default Pages Menu View in wp-admin
- Redirects from Tumblr to new WP
- WordPress redirecting to 127.0.0.1 when accessing the site from a remote device
- Stop wordpress redirecting www to non-www
- WordPress Global Redirect
- Why does wp_redirect strip out %0A (url encoded new line character) and how do I make it stop?
- Redirect page to first post in custom post type
- Which is better: 301 Redirect in my .htaccess file or a plugin like Redirection?
- WordPress Redirect Not Working – AJAX Callback Response Not Picked Up
- How to make wordpress folder (/wordpress) redirect to /?
- 301 redirect for converted post type
- Redirect Site Geologically
- .htaccess rules for blocking bots with an extra condition
- Multisite Subdomain Redirect Mask
- Two WordPress installations: One in root and one in sub directory – no images in subdir installation [closed]
- Set static page/post from another blog on same network
- A WordPress site with more than one domain name / Parked domains
- Redirect user if they are not logged in
- How to redirect a wrong search on my wordpress website to the error 404 page?
- How to check User Role and redirect to specific page according to Role when login in WordPress?
- store URL global before we redirect
- Will deleting WP’s code in .htaccess cause problems?
- How to redirect homepage to actual URL?
- Migrating to Tumblr [closed]
- How to fix automatic redirects?
- Restrict content access to logged in users
- How to redirect non existent pages/posts in wordpress using htaccess
- Blackberry mobile theme redirection
- wp redirect 301 not working in wordpress page
- Change url of page according to my requirements in wordpress
- How to redirect a child page to its parent page?
- wp_login_form() redirect same page
- How to Login a User inside a Plugin and Redirect to page?
- Redirect user after login to prior page through a wp_login hook
- Auto redirect to different web page
- Custom Post Type canonical link / pagination redirecting to root
- using wp_rewrite but keep the original url in the address bar
- Some links keeps redirecting to another domain
- Redirect every link that starts with
- Post redirected to page with same name but DIFFERENT permalink
- Make URL like /fr/something display same as /something
- Wrong Redirection
- Rewrite rule for incoming urls
- Nginx Multisite redirects (incorrectly) on Chrome IE and Mobile, but works (correctly) on Firefox
- wp_login_form: Redirect to dynamic url according to username
- Plugin redirects URL structure using 301 redirect. Time to disable the plugin?
- How to redirect root blog to a specific one in multilang WP?
- Redirecting to a post based on a GET parameter and a custom field
- Redirect a WP to another with all URL