Title: Regex Flags in Redirection
Last modified: September 1, 2016

---

# Regex Flags in Redirection

 *  [jplwood](https://wordpress.org/support/users/jplwood/)
 * (@jplwood)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/regex-flags/)
 * Hi, I’m hoping to do a regex that ignores case but Redirection doesn’t seem to
   allow for regex flags. For example, I want to redirect .pdf files that contain
   the string “bod” in it. I’ve gotten it to work on sample file names with a lowercase
   match when the redirect is set to:
 * /(.*bod?.*\.pdf)
 * But when I try to specify the regex flag to ignore case, which comes after the
   closing “/” in the regex, the match doesn’t seem to take:
 * /(/*bod?.*\.pdf/i)
 * A working example can be found here: [http://regexr.com/3djf9](http://regexr.com/3djf9)
 * Is there a way to specify regex flags in Redirection when using Regular Expressions
   in the URL?
 * [https://wordpress.org/plugins/redirection/](https://wordpress.org/plugins/redirection/)

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

 *  Plugin Author [John Godley](https://wordpress.org/support/users/johnny5/)
 * (@johnny5)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/regex-flags/#post-7461972)
 * It’s not currently possible, no.
 *  [micah.mount](https://wordpress.org/support/users/micahmount/)
 * (@micahmount)
 * [9 years, 1 month ago](https://wordpress.org/support/topic/regex-flags/#post-9024327)
 * Hi John,
 * First off–thank you very much for this excellent plug-in–I rely on it daily and
   I’m a huge fan.
 * I would like to add my +1 for supporting flags when checking the regex box.
 * If I could also ask a huge favor; could you update your documentation to explicitly
   note that flags are not supported ATM in this use case? I was really confused
   by this as your documentation says to consult a regex website, so I did, and 
   had my regex correct according to the site; then, naturally, was beating my head
   against a wall trying to figure out what I was doing wrong when it didn’t work
   using the plugin! 😉
 * Thanks again for such a great plug-in; it really is excellent!
 * Best,
    Micah

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

The topic ‘Regex Flags in Redirection’ is closed to new replies.

 * ![](https://ps.w.org/redirection/assets/icon-256x256.jpg?rev=983639)
 * [Redirection](https://wordpress.org/plugins/redirection/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/redirection/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/redirection/)
 * [Active Topics](https://wordpress.org/support/plugin/redirection/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/redirection/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/redirection/reviews/)

## Tags

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

 * 2 replies
 * 3 participants
 * Last reply from: [micah.mount](https://wordpress.org/support/users/micahmount/)
 * Last activity: [9 years, 1 month ago](https://wordpress.org/support/topic/regex-flags/#post-9024327)
 * Status: not resolved