How does “Redirects” work in Bullet?
Click “Domains” from Bullet dashboard
- Under “Redirects” fill in your old path and your new path
- Hit “Add Redirect”
A project can have a maximum of 2,000 static redirects and 100 dynamic redirects for a total of 2,100 redirects. Each redirect declaration has a 1,000-character limit. If there are multiple redirects for the same source path, the topmost redirect is applied.
Make sure that static redirects are before dynamic redirects in your
_redirects
file.
Supported Redirect formats
Feature | Old Path | New Path | Notes |
---|---|---|---|
Redirects | /home | / | 302 is used as the default status code. |
Splats | /blog/* | /blog/en/:splat | Refer to Splats. |
Placeholders | /blog/:year/:month/:date/:slug | /news/:year/:month/:date/:slug | See Placeholders |
Force | /pagethatexists | /otherpage | Redirects are always followed, regardless of whether or not an asset matches the incoming request. |
Matching
Redirects happen before headers, so if a request matches rules in both files, redirect will win out
Splats
On matching, a splat (asterisk, *
) will greedily match all characters. You may only include a single splat in the URL.
The matched value can be used in the redirect location with :splat
.
Placeholder
A placeholder can be defined with :placeholder_name
A colon indicates the start of a placeholder, and the name that follows may be composed of alphanumeric characters and underscores, :\w+. A placeholder with any given name can only be used once in the URL. Placeholders match all characters apart from the delimiter, which: when part of the host, is a period or a forward-slash; and when part of the path, is a forward-slash.
The matched value can similarly be used in the redirect location with :placeholder_name
. By doing this, it allows for greater flexibility and easier usability for both users and developers.
Unsupported Redirects
The following redirects are not supported. Make sure to not use any of these.
Feature | Old Path | New Path |
---|---|---|
Query Parameters | /shop?id=:id | /blog/:id |
Rewrites (other status codes) | /blog/* | /blog/404.html |
Proxying | /blog/* | https://blog.my.domain/:splat |
Domain-level redirects | workers.example.com/* | workers.example.com/blog/:splat 301 |