Basics
Features
Best Practices
Addon Development
Related Docs
Dark Mode

#Redirects Best Practices

It's important to use the correct response code for your redirects. For example, if you have an inactive campaign that you may enable again in the future, use a 302 while it's disabled so visitor's browsers don't permanently record that the page is gone. 301 means "Moved Permanently", so browsers will do things like automatically update the visitor's bookmark to the new URL which may not be what you want.

Always add descriptions for redirects as it may be very difficult for others to understand what your regular expression does and why. This also allows others to remove unneeded redirects.

Use a website like Regexr to test your regular expressions. Paste the From field into Regexr and then type a few sample URLs at the bottom to make sure the match is working. Make sure you don't match anything you don't want to as well.

You can enable/disable redirects for testing to see if a redirect is working without having to completely delete and replace it.

Link directly to the destination you want to avoid redirect chains. For example, if you link from https://example.com/old to http://example2.com/new/, you may get a redirect from http:// to https:// first, then another redirect from /new/ to /new. This applies to subdomains as well, so if a website uses www. in their URL, make sure you include it and don't include it if they don't.