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
- 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?
- Redirect entire website to a single page
- Redirecting WordPress /.htaccess / HSTS / SSL
- Site redirects to wrong url when saving settings
- Htaccess redirect from ‘/%postname%.html’ to ‘/%postname%’
- Index in root, wordpress in subdirectory
- Redirect www to non-www htaccess
- Specific URL has 403 Forbidden status code
- Custom domain for sub-section of parent website
- Redirect to https not working with .htaccess [closed]
- add_rewrite_rule to pass entire path as a single parameter
- htaccess redirect dynamic posts
- WordPress site in subdirectory load site in main directory
- some url does not redirect from http to https
- Why can’t I access files / directories outside of wordpress
- Redirect blogpage /blog/abcd/ to /blog/
- How to redirect from various ?page_id= to home page?
- Rewrite rule to load images from production does nothing
- Redirect all pages except one to homepage via .htaccess
- Redirect 301 www.my-site.com/page/n to www.my-site.com/ [closed]
- WordPress rewrite rules don’t need ^?
- Headless WordPress redirect front-page to login page [closed]
- htaccess redirects and WordPress
- 301 Redirect To Post ID
- htaccess rules not applied?
- Use virtual pages point to one specific page
- How to add new redirection on wordpress site
- Load time cost of using a redirect plugin v direct .htaccess entry
- htaccess redirect invoice.php to /client/invoice.php
- How to set 301 redirection after moving WordPress blog?
- 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
- 301 redirection editing .htaccess doesn’t work
- Redirect custom post type from one domain to another domain
- 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
- 301-redirect directives for blogger to wordpress migration
- reducing number of URL Redirects and increasing speed
- 301 Redirect all page and post urls from .html to /
- How to use https on one page only?
- .htaccess 301 redirect conflict with plugin “WordPress Https”
- 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
- Create a permalink to a pdf?
- How can I redirect users on the new 404 page without plugin?
- How do I write a subdomain redirect?
- htaccess redirect from specific urls of my site to the homepage
- 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
- How do I make WordPress revise an .htaccess file a certain way?
- Mass .htaccess URL Forwarding
- Redirection with a wildcard
- Redirect posts to new domain
- Is it possible to change redirect template through a shortcode?
- Using cache brokes redirecting
- 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 HTTP request to HTTPS request
- 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
- Rewrite rule to redirect to a particular filename.php
- How to redirect all pages of a blog to a new blog
- WordPress subfolders htaccess bypassing the root htaccess RewriteRule
- Running non-WordPress PHP files