Skip to content

Redirects

Add 301 and 302 redirect rules, match patterns with regex, order them, test a URL, and import rules from CSV.

Redirect rules send visitors from one path to another before WordPress runs. Open your site, then Redirects, to add, order, test, import, and export rules for the environment you are looking at.

Redirects run on your site's web server (Nginx), so they work the same on every plan and regular expressions are always available. The line above the table says where your rules run and when they last changed.

Add a rule

  1. Open your site, then Redirects.
  2. Choose Add redirect rule.
  3. Enter the source path and the destination.
  4. Pick 301 (permanent) or 302 (temporary).
  5. Tick Regex to match a pattern, such as ^/old/(.*)$ to /new/$1.
  6. Set Domain scope to limit the rule to one hostname, or leave it for every hostname.
  7. Save.

Avaloi applies the rules through a job. The tab shows its progress.

Order the rules

Rules run in the order you see them, and the first matching rule wins. Open the three dot menu on a rule and choose Move up or Move down to change its place. Put specific rules above broad ones, so a regex that matches many paths does not catch a page that has its own rule.

Avoid loops

Avaloi refuses a rule that would send visitors around in a circle, and tells you which rule to change. Fix that rule, then save again.

Test a URL

Use the tester to try a URL against the current rules. It shows every hop and where the URL finally lands, so you can see which rule matched and whether a chain of rules behaves as you expect.

Import rules from CSV

  1. Prepare a CSV file with the columns source, destination, status code, regex, and domain scope.
  2. Open the three dot menu next to Add redirect rule, choose Bulk import, and paste the CSV.
  3. Review the parsed rules and any problems the import found.
  4. Confirm to save.

The import runs as a dry run first and saves nothing until you confirm. Through the API, dry_run defaults to true and returns the parsed rules with their problems. Send dry_run: false to save.

Edit, turn off, or delete rules

Use the Enabled switch to turn a rule off without deleting it. Open the three dot menu on a rule to edit or delete it. Tick several rules to enable, disable, or delete them together. Each change applies through a job.

Search, filter, and export

Search by path or domain, and filter by enabled, disabled, 301, 302, or regex rules. Export as CSV, in the three dot menu at the top, downloads every rule in the same columns the import reads.

Limits

  • An environment holds up to 500 rules.
  • Up to 100 of those rules can be regex.

Quick answers

My rule does not fire. Check the order. An earlier rule may match first. Use the tester with the exact URL to see which rule wins.

Can I redirect only one hostname? Yes. Set Domain scope on the rule. Rules without a scope apply to every hostname on the environment.

Should I use 301 or 302? Use 301 when the move is permanent, so browsers and search engines remember it. Use 302 for a temporary move.

Why was my import refused? The preview lists each problem next to the rule that caused it. Fix the CSV and import again.

API

  • GET /v1/environments/{id}/redirects
  • POST /v1/environments/{id}/redirects
  • PUT /v1/environments/{id}/redirects/{rule_id}
  • DELETE /v1/environments/{id}/redirects/{rule_id}
  • POST /v1/environments/{id}/redirects/import
  • POST /v1/environments/{id}/redirects/test

Still stuck?

Email [email protected] with your site name and what you tried, or send us a message.