Am I missing something simple?
You need the L
flag (to prevent further processing) and this directive should go at the very top of your existing .htaccess
file (ie. before the # BEGIN WordPress
section).
Unless you have already defined an appropriate RewriteBase
directive (the WordPress front-controller usually has this), then you also need to prefix the substitution string with a slash (although it is recommended to do this anyway for external redirects).
Otherwise, your regex and substitution string should work OK.
In other words, at the top of your file:
RewriteRule ^(.*)/item/(.*)-([0-9]+)$ /$1/item/$3 [R=302,L]
Test with 302 (temporary) redirects (to avoid caching issues) and change to a 301 only when you have confirmed it works as intended.
You will need to clear your browser cache before testing.
Related Posts:
- 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?
- Redirections and rewrites to subdomain
- How To Fix A Redirect Chain
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Redirect – remove custom query string
- Understanding Redirects
- Cannot get 301 redirection in htaccess to work (either Redirect or Rewrite)
- htaccess and redirect to new url using regex
- WordPress on a subfolder but accessible from root
- htaccess – Redirect to subfolder without changing browser URL
- How do I skip wordpress’s 404 handling and redirect all 404 errors for static files to 404.html?
- Non-WordPress page in subdirectory under WordPress page
- Redirecting WordPress /.htaccess / HSTS / SSL
- How to redirect url requests to https? [closed]
- Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
- Redirecting old permalink to new one
- Redirect www to non-www htaccess
- Specific URL has 403 Forbidden status code
- Problem to redirect custom page using htaccess
- htaccess redirect not working
- htaccess wildcard redirect misses some URLs
- How to do 301 redirect to Sub page using htaccess file?
- WWW to non WWW redirect effects on load speed
- Why specific file directory fails to redirect but its parent folder succeeds?
- How to redirect from various ?page_id= to home page?
- Deny access to a path (give 403 or 404 response)
- htaccess 301 redirect http to https doesn’t work
- Redirect home to another page with htaccess
- Redirect all pages except one to homepage via .htaccess
- 301 Redirect Loop
- Redirect 301 www.my-site.com/page/n to www.my-site.com/ [closed]
- Headless WordPress redirect front-page to login page [closed]
- Use htaccess to redirect WordPress to static website in a subfolder
- htaccess redirects and WordPress
- 301 Redirect To Post ID
- set up 301 redirect within wp-content/uploads/ directory of a WP site to a new image URL
- Redirect from sub-directory to root – New WordPress 5.2.3 Set up
- How to add new redirection on wordpress site
- htaccess redirect invoice.php to /client/invoice.php
- .htaccess Redirect
- How to set 301 redirection after moving WordPress blog?
- How can I redirect a URL to an anchor link while maintaining the URL?
- How to remove duplicate and unnecessary part in a url using htaccess and regex?
- Redirect homepage with htaccess, except if I enter the link adding “/home”
- How to remove wordpress directory slash
- Wrong Redirect/Rewrite Rules?
- Redirect all requested url to new url
- Built-In Postname Redirection vs Hard Redirects in relation to SEO and performance
- How To Fix 404 errors caused by Google Indexing WordPress In Subdirectory
- Can’t control WordPress Addresses from admin panel
- Unable to access folders in same level as wordpress installation
- reducing number of URL Redirects and increasing speed
- 301 Redirect all page and post urls from .html to /
- Redirect “http://old.net/category/postname” to “https://new.com/postname”?
- Image URLs not redirecting properly
- 301 Redirect Old URL to New WordPress Page
- How to use https on one page only?
- URL masking of subdomain to main domain using .htaccess
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- How do I put up a splash page and have all WordPress links redirect to this page?
- How do I do a redirect to WordPress permalink with post id via htaccess?
- Prevent wordpress autoredirect
- Stop forcing certain paths to end with a forward slash
- How to redirect only 404 pages with htaccess in WordPress
- How to redirect the frontend of a WordPress site (only)?
- Redirect from ip to domain
- Permalinks do not include www subdomain
- How can I redirect users on the new 404 page without plugin?
- 301 redirect any RSS feed on level up url
- How do I write a subdomain redirect?
- htaccess redirect from specific urls of my site to the homepage
- HTTPS to HTTP rewrite rules not working as expected
- How to redirect multiple subfolders back to root domain?
- How do I Redirect Tags from Old Joomla Site to New WordPress Site?
- htaccess 301 Redirect not working from aspx to new WP permalink
- Mass .htaccess URL Forwarding
- Redirection with a wildcard
- Redirect posts to new domain
- Open wordpress page in directory the way index.html would open
- Using cache brokes redirecting
- 301 Redirect in WordPress not working in htaccess
- WordPress site not forcing from http to https instead getting redirected too many times
- How to make front page temporarily show content of internal page
- Redirect after login when WordPress in subdirectory
- Redirect HTTP request to HTTPS request
- Redirect after Permalink change – What regex do I use?
- home page redirect loop after update to 4.8
- Resolving the too many redirects on wordpress
- 301 Redirects when change URL in WordPress database
- Redirect wordpress website URL into other link
- What’s the best way to redirect to a new wordpress website?
- Redirect old .html URLs to a new installation in a subfolder
- Subpages return 404 server error
- WordPress 302 Redirect to Holding Page
- How to redirect all pages of a blog to a new blog
- Redirect a WP to another with all URL
- Redirect ignore last URL segment
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error