HTTP Redirect

DNS-powered HTTP redirects — no servers, no config files.

HTTP Redirect provides a service that will redirect any domain or subdomain using only DNS records. Point your domain at this service, add a TXT record with the destination URL, and redirects are served automatically.

STEP 1 Point your domain at this server

Create a CNAME or A record for the domain you want to redirect:

# CNAME
www.example.com.    IN  CNAME  http-redirect.org.
# or A record
example.com.        IN  A      195.114.14.133

STEP 2 Add a TXT record with the destination

Create a TXT record prefixed with _redirect on the same domain, containing the target URL:

_redirect.www.example.com.  IN  TXT  "https://www.new-site.com"

_redirect.example.com.      IN  TXT  "https://new-site.com"

DNS changes may take a few minutes to propagate.


Status codes

By default, redirects are issued with the 302 Found status code. Append an alternate response code (301, 302, 307, 308) or keyword (permanent, temporary) to override:

# 302 (default)
_redirect.www.example.com.  IN  TXT  "https://www.new-site.com"

# 301 Permanent redirect (numeric)
_redirect.www.example.com.  IN  TXT  "https://www.new-site.com 301"

# 301 Permanent redirect (keyword)
_redirect.www.example.com.  IN  TXT  "https://www.new-site.com permanent"

Dynamic redirects

Preserve paths, query strings, and other request details using placeholders:

# Preserve path and query string
_redirect.www.example.com.  IN  TXT  "https://www.new-site.com{path}{?query}"

# Preserve full URI
_redirect.www.example.com.  IN  TXT  "https://www.new-site.com{uri}"

# Keep original scheme
_redirect.www.example.com.  IN  TXT  "{scheme}://www.new-site.com{uri}"
Available placeholders
PlaceholderDescription
{scheme}Request scheme (http or https)
{host}Hostname of the request
{uri}Full URI including path and query
{path}Request path only
{query}Query string without ?
{?query}Query string with ? (omitted if empty)
{file}Filename component of the path
{dir}Directory component of the path

Examples

Redirect a subdomain
blog.example.com.            IN  CNAME http-redirect.org.
_redirect.blog.example.com.  IN  TXT   "https://medium.com/@yourname"
Migrate a site and preserve all URLs
www.old-domain.com.            IN  CNAME http-redirect.org.
_redirect.www.old-domain.com.  IN  TXT   "https://www.new-domain.com{uri} 301"
Redirect a bare domain
example.com.            IN  A    195.114.14.133
_redirect.example.com.  IN  TXT  "https://www.example.com{uri} 301"