Title: Help with regex for redirection.
Last modified: August 30, 2016

---

# Help with regex for redirection.

 *  Resolved [thomaslester](https://wordpress.org/support/users/thomaslester/)
 * (@thomaslester)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/help-with-regex-for-redirection/)
 * Hello!
    I have made a new homepage for a customer, now wanting to make correct
   redirects from the old page. The customer works with artist booking.
 * Unfortunately the old had 4-5 URL´s for each artist like this:
 * bifald.dk/?IId=210&EId=&E=Book
    bifald.dk/?IId=210&EId=13&E=Book bifald.dk/?Iid
   =210&Eid=13 bifald.dk/?Iid=210 bifald.dk/Print.asp?IId=210
 * and
 * [http://bifald.dk/?IId=21&EId=12&E=Book](http://bifald.dk/?IId=21&EId=12&E=Book)
   
   [http://bifald.dk/?IId=21&EId=12](http://bifald.dk/?IId=21&EId=12) [http://bifald.dk/Print.asp?IId=21](http://bifald.dk/Print.asp?IId=21)
   [http://bifald.dk/?IId=21](http://bifald.dk/?IId=21) [http://www.bifald.dk/?Iid=21](http://www.bifald.dk/?Iid=21)
 * NOTE: the IId with both II and Ii.
 * I would like to use Regex 301 redirects, but I´m totally new to this.
 * My idea is to look for the artist number ”210” and because the two first letters
   are changing case, I thought of just using the ”d=210”
 * It works when I just put ”d=210” as the regex expression, but the problem is 
   how to avoid that artist with number 21 to be redirected to the new 210 page.
   21 is contained in 210!
 * How to program the regex to see difference between 2 and 3 digits?
 * I can´t use the ”&” as a guide, because not all Urls have an & after the artist
   number.
 * Any help will be deeply appreciated.
    Best Thomas
 * [https://wordpress.org/plugins/wordpress-seo/](https://wordpress.org/plugins/wordpress-seo/)

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Thread Starter [thomaslester](https://wordpress.org/support/users/thomaslester/)
 * (@thomaslester)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/help-with-regex-for-redirection/#post-6638683)
 * Hello!
    I solved it! This is the answer (210&|210$) and (21&|21$)
 *  [AskKim](https://wordpress.org/support/users/askkim/)
 * (@askkim)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/help-with-regex-for-redirection/#post-6638726)
 * Well done Thomas! Glad to hear that you got it sorted!
 * ~ Kim ~
    Support at Yoast

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Help with regex for redirection.’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-seo/assets/icon-256x256.gif?rev=3419908)
 * [Yoast SEO - Advanced SEO with real-time guidance and built-in AI](https://wordpress.org/plugins/wordpress-seo/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-seo/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-seo/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-seo/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-seo/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-seo/reviews/)

## Tags

 * [redirect](https://wordpress.org/support/topic-tag/redirect/)
 * [regex](https://wordpress.org/support/topic-tag/regex/)

 * 2 replies
 * 2 participants
 * Last reply from: [AskKim](https://wordpress.org/support/users/askkim/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/help-with-regex-for-redirection/#post-6638726)
 * Status: resolved