Use regex to replace underscore dashes in URLs Wordpress blog

I recently replaced all urls on my Wordpress blog that contain an underscore with a dash.

An example of an old url: / This _is_a_test

Example of a new url:
/ This is a test

However, Google is still indexing my bad urls using the underscore. Unfortunately, this leads to 404 errors.

How can I fix this problem by setting up 301 regex redirects using the redirect plugin in Wordpress?

The plugin offers me the following settings: Redirection plugin settings

What regular expression should I use to correctly translate all urls with underscores in URLs with dashes?

Thank.

+3


source to share





All Articles