Skip to content

Backgrounds

How-to Guides

Technical References

Redirects /

Writing redirects directly into your theme code

VIP has a couple of helper functions for broader redirects.

  1. vip_regex_redirects — advanced 301 redirects using regex to match and redirect URLs. Warning: Since regex is expensive and this will be run on every uncached page load, you’ll want to keep this small, lean, and mean.
  2. vip_substr_redirects — wildcard redirects based on the beginning of the request path. This is basically an alternative to vip_regex_redirects() for when you only need to redirect /foo/bar/* to somewhere else. Using regex to do this simple check would add lots of overhead.

Last updated: September 29, 2021