Inside this article, we'll go over the various columns and operators that are available when importing redirect rules from a CSV.
This article serves as a reference to use when defining rules and isn't meant to be a tutorial. If you're looking for more of a tutorial, see our article on importing redirect rules into Atomic.
Redirect Rule CSV Template
If you have existing rules, you can export your current redirects and make your changes there.
If not, you can download our redirects CSV template to get started.
Redirect CSV Columns
- from
- to
- fromScheme
- fromDomain
- fromPath
- fromQueries
- toScheme
- toDomain
- toPath
- toQueries
- statusCode
- enabled
- queryMode
- description
from
This column defines a basic path to redirect from.
If you want to perform redirects based on more than an exact path, see the fromPath column.
Example
/redirectme
to
This column defines a basic path to set as the redirect destination, used in combination with the from column.
If you're redirecting from anything other than the basic from column, you'll want to use the toPath column instead.
Example
/destination
fromScheme
Defines the scheme to be matched when applying redirect rules. If the scheme does not match, the redirect will not occur.
If left empty, all schemes will be redirected if other rules match.
Possible Values
http
https
fromDomain
Defines the domain that the rule will need to match for a redirect to occur.
If left empty, all domains will be redirected if other rules match.
Example
example.com
fromPath
This column is similar to the from column, but allows for additional parameters to be defined.
Match Parameters
contains
starts-with
ends-with
Examples
Redirect a static path:
/redirectme
Redirect if the path contains a string:
keyword::contains
Redirect if the path starts with a string. Useful for redirecting entire directories:
/example_directory::starts-with
Redirect if the path ends with a string. Useful for redirecting certain extensions:
.extension::ends-with
fromQueries
This column matches query strings in the URL. Both keys and values can be matched. You can also apply additional parameters to your matches.
Match Parameters
contains
starts-with
exists
empty
Examples
Redirect if the query string exactly matches keys/values:
?key
?key=value
?key=value&anotherkey=anothervalue
Redirect if the query string contains a specific key/value pair:
?key=value::contains
Redirect if the query string starts with a specific key/value pair:
?key=value::starts-with
Redirect if the query string ends with a specific key/value pair:
?key=value::ends-with
Redirect if a key exists, regardless of the value:
?key::exists
Redirect if a key is empty:
?key::empty
toScheme
This column will redirect any matches to the scheme specified. If no value is specified, the scheme will stay the same.
Possible Values
http
https
toDomain
This column will redirect the URL to another domain. If left empty, the domain will remain unchanged.
Example
example.com
toPath
This column defines a static path to the redirect destination. If left unchanged, the path will not change (but other rules may still change, such as query strings, the domain, scheme, etc.)
When performing any redirects are not using the simple to/from fields, any redirect destination paths are set here.
Example
/destination
toQueries
This column contains a list of query strings to be applied to the redirect destination.
The contents of this column can either update and append existing variables or replace all existing keys/values, depending on what's set in the queryMode column.
Examples
?key
?key=value
?key=value&anotherkey=anothervalue
queryMode
This column defines how the destination query strings from the toQueries column are handled.
Possible Values
update
replace-all
statusCode
This column defines the status code of the redirect.
Possible Values
301
302
enabled
This column defines if the rule is active or not.
Possible Values
true
false
description
This column is just a description of the rule.