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
- The wp-admin url for each site does not work on WordPress multisite
- 301 Redirect via rewrite_rules_array (not .HTACCESS)
- Redirect from an HTML page
- Redirect from an HTML page
- How do I make a redirect in PHP?
- How do I make a redirect in PHP?
- How do I redirect to another webpage?
- How do I redirect to another webpage?
- In the shell, what does ” 2>&1 ” mean?
- How to redirect all HTTP requests to HTTPS
- Is there a way to follow redirects with command line cURL?
- In the shell, what does ” 2>&1 ” mean?
- Redirecting to URL in Flask
- PHP page redirect
- How to remove .html from URL?
- The page was not displayed because the request entity is too large on IIS
- How to remove .html from URL?
- The page was not displayed because the request entity is too large on IIS
- PHP header(Location: …): Force URL change in address bar
- How can I use an .htaccess file in Nginx?
- 404 Not Found The requested URL was not found on this server
- Server.Transfer Vs. Response.Redirect
- What does HTTP/1.1 302 mean exactly?
- .htaccess – how to force “www.” in a generic way?
- How to enable mod_rewrite for Apache 2.2
- How to redirect a URL path in IIS?
- ExpressJS : res.redirect() not working as expected?
- php refresh current page?
- How do you redirect HTTPS to HTTP?
- .htaccess Remove WWW from URL + Directories
- How does RewriteBase work in .htaccess
- How to manage a redirect request after a jQuery Ajax call
- Redirect website after specified amount of time
- How to use $_SERVER[‘HTTP_REFERER’] correctly in php?
- window.location.replace() not working to redirect browser
- javascript window.location in new tab
- Getting a 500 Internal Server Error on Laravel 5+ Ubuntu 14.04
- Page redirect after certain time PHP
- Nodejs – Redirect url
- Redirect after Login on WordPress
- Redirect old php link to wordpress link in .htaccess
- Redirect old php link to wordpress link in .htaccess
- Safely redirect old WordPress blog links to new WP blog
- Apache mod_rewrite Infinite Loop when Accessing WordPress Admin Dashboard
- Double slashes on WordPress Admin URL redirects to wp-login
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Cant login to wp-admin (redirecting to homepage), But CAN login to wp-login.php
- Page Redirection in WordPress
- How to create custom URL routes?
- How to force a 404 on WordPress
- Resolve a custom post type name vs. page permalink conflict (same slug)
- Disable front end to use as CMS only?
- remove “index.php” from permalinks
- Redirect Restricted Page to 404
- How to redirect non-logged in users to a specific page?
- “Too many redirects” ONLY when trying to access wp-admin page
- How to prevent automatic redirection of 404 errors and “incorrect” URLs?
- Which hook should be used to add an action containing a redirect?
- Admin Page Redirect
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- Disable WordPress URL auto complete
- Host the wp-admin on another domain?