How to create regex redirects so they are not greedy
A greedy redirect will catch urls it should not and redirect them because they have a word or words in them. To avoid that, follow these steps:
Go to the dashboard by hovering over GEN - Genetic Engineering and Biotechnology News on the top left of the site: (You will only see that black bar if you are logged in):
Then go to Tools > Redirection:
Create a new redirect by clicking the Add New button to reveal the fields shown below:
In the Source Url field:
the url should be in the following format:
^/url-string/?$
KEY
^ means the domain
/url-string/ means the thing you want to redirect
? means it could be followed by a slash
$ means end of string.
The $ is critically important. It prevents the redirect from affecting other urls that have that string or word in it in the case of short redirects and will prevent the issue we had yesterday from happening.
Redirect Set Up Continued
Click the URL Options/ Regex drop down arrow:
Click the checkbox next to regex:
Click the Regex box:
Click ignore case:
Do not click to ignore slash. Leave that checkbox empty because that has been handled already by the way you constructed the source url. See the key above for details:
Fill in the target field with the url you want to redirect to:
Click the Add Redirect button to create the redirect: