I have a website that was converted from 1 platform to another. I have many thousands of pages indexed that look like this:
domain.com/test/red_widget.html
domain.com/test/big_red_widget.html
domain.com/test/small_nice_red_widget.html
that need to look like this:
domain.com/test/red-widget.html
domain.com/test/big-red-widget.html
domain.com/test/small-nice-red-widget.html
So all the URLs in question in this example are located in the "test" path, use underscores and have an html extension.
And I need all urls in the "test" path with an html extension to be rewritten as is except the underscores, "_", would be replaced with dashes, "-".
I've tried a lot of stuff but I can get compatibility with my current htaccess rules which need to continue to work.
Right now I have this rule:
RewriteRule ^test/(.*).html$ /?kw=$1
which does work but for a url like domain.com/test/small_nice_red_widget.html, the kw parameter will be set as small_nice_red_widget whereas I really need it to be set as small-nice-red-widget.
Any guidance or if anyone can point me in the right directions will be greatly appreciated.