Found that solution useful
I think, this is an expensive way to replace underscores with dashes. But this works at least in my test environment. The first rule replaces dashes one by one. The second rule then removes the prefix from the requested URL.
RewriteBase /
# replace underscores with dashes
RewriteRule (.+?)_(.+) $1-$2 [R=302,L]
# strip "news/index.php"
RewriteRule ^news/index.php/(.*) /$1 [R=302,L]
Related Posts:
- Redirections and rewrites to subdomain
- Cannot get 301 redirection in htaccess to work (either Redirect or Rewrite)
- Old blog/ and blog/feed/ URLs not working after moving blog to top-level via .htaccess
- RedirectMatch and Redirect interfering with each other
- Menu links only using http after enabling https, unable to redirect http links
- Why specific file directory fails to redirect but its parent folder succeeds?
- 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?
- Redirect home to another page with htaccess
- .htaccess rule to redirect old URLs to new structure [closed]
- How To Fix A Redirect Chain
- Image URLs not redirecting properly
- How to remove the [L] Flag for WordPress index .php mod_rewrite
- Redirect – remove custom query string
- Redirect old query string URLs to new add_rewrite_rule URL
- HTTPS to HTTP rewrite rules not working as expected
- ErrorDocument 410 gives me back a 302 header
- Understanding Redirects
- How to create multiple Rewrite-Rule for various site in single htaccess?
- WordPress on a subfolder but accessible from root
- WordPress Redirect All HTTP requests to HTTPS via .htaccess
- Non-WordPress page in subdirectory under WordPress page
- Force HTTPS using .htaccess – stuck in redirect loop
- 301 redirect not working through .htaccess
- How to change default page slug?
- How to redirect url requests to https? [closed]
- 302 redirect instead of 301 after switch to HTTPS
- How do I skip wordpress’s 404 handling?
- Problem to redirect custom page using htaccess
- Redirect from https to http or from http to https? [closed]
- Redirect too many times htacces switching to https
- How to do 301 redirect to Sub page using htaccess file?
- Can WordPress redirect to a “similar page” in case of 404 error
- Hacked website redirect, only on desktop, help with restoring it [closed]
- Custom rewrite rule
- How to hide that a certain non-WordPress directory exists on the server?
- Redirect “any page/page/number/” to “any page”
- WordPress multisite htaccess redirection to new domain
- WordPress blocking/preventing viewing of .cgi file in subdirectory [closed]
- https redirect (with .htaccess) redirect loop
- htaccess 301 redirect http to https doesn’t work
- Redirecting old post url to 404 in wordpress using htaccess
- How to redirect subcategories to a page?
- Use htaccess to redirect WordPress to static website in a subfolder
- Redirect blog archive into certain format
- CNAME vs A Record for WWW – with 301 Redirects
- How to publish new posts/pages in root instead of subfolder, but keep old structure in place?
- forward domain name to particular page?
- How can i redirect one url to another url using .htaccess or add_rewrite_rule
- 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 redirect URL with subfolder to the same URL but without subfolder?
- htaccess 301 Redirect not working for WordPress site
- What is the right way to redirect all traffic to HTTPS?
- Custom Permalink
- Site loads very slowly (4-5 minute load time)
- I need to redirect an entire subdirectory in WordPress to the homepage – is this correct?
- 503 Service Unavailable error was encountered
- SSL and www to non-www redirection works only on homepage – WordPress
- Redirecting old permalink structure to new in htaccess
- WordPress keeps redirecting subpages without http to https homepage after switch
- Rewriting “pretty” blog category URL with htaccess / add_rewrite_rule() causes 404 page
- URL without www redirect directly with submission page – Multiwordpress install
- ReDirect subfolder link to another sub-folder and force SSL
- Why does WordPress redirect when I separate wp-core and wp-content?
- What is the most efficient (ie. less server intensive) way for 301 redirects?
- How to forward all requests starting with a specific folder name to the same folder
- Issue redirecting ‘blog’ to ‘news’ in WordPress using .htaccess
- Will deleting WP’s code in .htaccess cause problems?
- Use two different index pages
- Create a permalink to a pdf?
- How to redirect an old page url to the homepage
- How can I redirect a request to the site root using htaccess, if there’s not a specific cookie set?
- Custom URL routes
- redirecting an entire WP site from one top level domain to another
- Is there way to redirect all blog post pages to Home page?
- get_bloginfo prints IP instead of url
- How to redirect non existent pages/posts in wordpress using htaccess
- Temporary Infinite Redirect Loop
- A question about .htaccess
- Error in /blog redirection – ubuntu default WP installation
- Redirect *.php to path using web.config file
- WordPress not linking correctly with .htaccess redirect to subdirectory
- 302 redirect *.at/site redirecting to .comsite
- Loading /wp-content/uploads/site as /site/
- Redirect only PDFs in different folders?
- How do I skip wordpress’s 404 handling?
- How to 301 redirect to subdirectory but keep access to wp-admin of main domain
- Pagination redirect set in .htaccess file is not working
- .htaccess not working after page slug change
- Redirecting a POST to a php script
- Debugging a redirect loop affecting only certain pages
- Migration from old CMS to WordPress 301 redirection rules?
- Can’t get pretty permalinks to work without index.php
- WordPress redirect from one directory to another but exclude wp-admin and wp-login.php
- Can I redirect the http request towards an old folder to the homepage using .htaccess file? [closed]
- Redirect a WP to another with all URL
- URL Redirect on GoDaddy platform [closed]
- Redirect ignore last URL segment
- Other pages fine but wp-admin showing ERR_TOO_MANY_REDIRECTS Error