Recommended Free Tools
To redirect one domain to another, point the old hostname at a service or server that can answer HTTP requests, then return a redirect response to the new URL. Use a server-side 301 (or 308) when the move is permanent; use 302, 303, or 307 for a temporary change. DNS alone cannot redirect a browser: DNS resolves a hostname, while an HTTP service sends the redirect.
Antihost offers Linux VPS plans with full root access, unlimited traffic on a 1 Gbps port and a 14-day free trial.
The safest migration preserves each old path and its query string only when the new site has an equivalent URL. If an old path has no meaningful replacement, send it deliberately to a useful page or the new root rather than creating a misleading destination.
As an Amazon Associate I earn from qualifying purchases.
Free tools Windows power users keep installed
One-click scans. No signup required.
What a domain redirect actually does
When someone requests https://old.example/page, the process has two separate stages:
- DNS resolution: The old hostname is resolved to an IP address or a proxy service through an A, AAAA, or CNAME record.
- HTTP response: The server or edge service receives the request and returns a 3xx status with a
Locationheader such ashttps://new.example/page. The browser, crawler, or API client then requests that target.
Changing an A record to the new site’s address does not, by itself, change the URL or produce a redirect. It merely sends traffic to another server. That server still needs a redirect rule, and it must be able to answer for the old hostname.
#1 Best Overall
For a complete domain move, cover every hostname people may use: the apex (old.example) and www.old.example, plus both HTTP and HTTPS where they are reachable. A redirect that handles only one of those variants leaves users or crawlers on the old site or produces a certificate or connection error.
Choose the correct HTTP status code
Google Search Central defines the distinction plainly: “The 301 and 308 status codes mean that a page has permanently moved to a new location.” It treats 301/308 as permanent signals and 302/303/307 as temporary signals.
Do these 3 things before closing this tab:
1Fix the driver behind crashes, sound loss and screen glitches2Clear out junk files and repair common Windows errors3Scan for outdated or missing drivers - takes under a minute| Status | Use it when | Important behavior |
|---|---|---|
| 301 Moved Permanently | The old URL has been replaced and the change is intended to last. | The conventional choice for a normal website move and ordinary GET requests. |
| 308 Permanent Redirect | The move is permanent and the original HTTP method must be retained. | Useful when POST, PUT, or another non-GET method must arrive at the target unchanged. |
| 302 Found | A campaign, outage workaround, experiment, or other temporary change. | Signals that the original URL remains the intended location. |
| 303 See Other | A temporary response should lead the client to retrieve another resource. | Useful when the follow-up request should be a separate retrieval rather than a method-preserving repeat. |
| 307 Temporary Redirect | A temporary move must preserve the original HTTP method. | Unlike a typical 302 implementation, it is explicitly method-preserving. |
For a permanent domain migration, configure a server-side 301 unless you have a specific reason to preserve methods, in which case use 308. Do not use a temporary code simply because it is convenient: it tells search engines and clients that the old address may return.
Plan the URL mapping before creating a rule
A domain redirect is not automatically a content migration. Decide how every important old URL maps to the new site first.
Preserve paths when URL semantics match
If old.example/products/widget represents the same resource as new.example/products/widget, keep the path and change only the host. This lets bookmarks, links, and search results reach the equivalent page.
Preserve query strings when they still matter
Parameters used for search, filters, campaign attribution, or application state may need to survive. Enable query-string preservation in an edge rule, or configure the server directive so the original query is carried to the target. Test a URL such as /search?q=term rather than assuming every parameter will be retained.
Send obsolete paths somewhere intentional
If the new site has no equivalent for an old path, do not blindly append that path to the new hostname. A resulting 404 or unrelated page can be worse than a deliberate redirect to the new root or to the closest genuinely relevant replacement. Cloudflare’s documented root-target pattern intentionally sends every old path to https://new.example/; use that pattern only when a root destination is appropriate.
Document exceptions
Make a mapping list for renamed sections, changed trailing-slash conventions, removed files, and language or subdomain changes. Put specific exceptions before a broad catch-all rule so an important page does not get swallowed by a generic destination.
Redirect a domain with Cloudflare
Cloudflare’s edge redirect products operate only when the old hostname is served through Cloudflare. The DNS records for the hostnames involved therefore need to be proxied, not merely listed as DNS-only records.
1. Add the old domain
Add old.example to the Cloudflare account and complete the nameserver or onboarding change required for the domain. Keep the old domain active; visitors must still be able to reach it while the migration is in progress.
2. Create records for every old hostname
Create proxied A or CNAME records for the apex and, if it is used, www. Confirm that requests for both names resolve through Cloudflare. If one hostname is missing, it may bypass the rule or fail before an HTTP response can be generated.
3. Create a Redirect Rule
In the dashboard, create a rule that matches the old hostname. A whole-domain pattern can resemble http*://old.example/*. Restrict the match to the exact old hostnames you own; do not use a broad expression that could capture an unrelated host.
4. Choose a dynamic or fixed target
When the URL structures correspond, set a dynamic target such as https://new.example/${2}, or concatenate the request path according to the rule’s expression syntax. This keeps a request such as /my/path/to/page.htm on the corresponding path at the new host.
Rank #2
When there is no equivalent path, set a fixed target of https://new.example/ instead. A fixed root target is a deliberate choice, not a fallback to apply to every migration.
5. Decide whether to preserve the query string
Enable query-string preservation when parameters are meaningful to the destination, including searches and campaign links. Leave it off when the new application does not understand the old parameters or when carrying them would create duplicate or misleading URLs.
6. Select the status and deploy
Choose a permanent 301 for a completed move, or a temporary status for a test or short-lived event. Deploy the rule, then test both HTTP and HTTPS requests for the apex and www hostnames. The final response should be one clean hop to the new HTTPS URL.
Cloudflare-specific failure points
- Rule never runs: The DNS record may be DNS-only instead of proxied, or the request may use a hostname not covered by the match.
- HTTPS error before redirect: The old HTTPS hostname still needs a valid certificate and a working edge configuration; a redirect cannot be returned if the TLS connection fails first.
- Wrong path: The dynamic expression may not capture the path segment you expected. Test a deep URL and inspect the exact
Locationheader. - Parameters disappear: Turn on query-string preservation or explicitly append only the parameters the new application supports.
Redirect with Apache
Apache can issue redirects with mod_alias or mod_rewrite. A simple path redirect using the syntax shown in Google’s server-configuration guidance is:
Redirect permanent "/old" "https://new.example/new"
Place the directive in the appropriate virtual-host configuration or, where permitted, in .htaccess. The old host must be selected by the virtual host, and the target should include the desired HTTPS scheme.
Outdated Drivers Are Slowing You Down
One free scan finds every outdated or missing driver and matches the right update for your exact hardware.Free scan · exact hardware matchPC Slower Than It Used to Be?
A free scan shows the junk files, broken settings and background clutter dragging Windows down - then fixes them in one click.Free scan · Windows 10 & 11Whole-domain moves
A whole-domain migration needs a rule that matches the old host and maps the requested path to the new host. Use mod_rewrite when you need host conditions, path capture, exceptions, or explicit query-string handling. Put exact exceptions first, then the host-wide rule, and finish with a fallback only if every remaining path has a useful destination.
Do not copy a path-preserving rule without checking its assumptions. If the new site changed /blog/post to /articles/post, a host-only replacement will send visitors to the wrong URL. Add a specific mapping for the changed section before the general rule.
Apache checks
- Make sure the required module is enabled and the configuration is valid before reloading Apache.
- Confirm that
AllowOverridepermits the directives if they are in.htaccess. - Keep the redirect response free of an HTML body requirement; the essential parts are the 3xx status and correct
Locationheader. - Check that the rule does not match the new hostname, which would create a loop.
Redirect with Nginx
Nginx can return a redirect directly from the relevant server or location block. For a single path, the documented form is:
location = /service {
return 301 https://new.example/about/service;
}
For a domain migration, define a server block that answers for the old hostname and return the new HTTPS host, preserving or transforming the URI as required by your mapping. Use exact locations for special cases and a carefully tested general rule for the rest.
Nginx checks
- Include both old hostnames in the
server_namedirective when both the apex andwwware in use. - Provide an HTTPS server block and certificate for the old hostname so an HTTPS request can reach the redirect.
- Run the configuration test before reload, then request a deep path and a query-string URL.
- Ensure the new hostname is not listed in the redirecting server block unless it is intentionally handled by a separate, non-looping configuration.
Redirect from application code
An application can send the response before writing any page body. A minimal PHP example is:
<?php
header('HTTP/1.1 301 Moved Permanently');
header('Location: https://www.example.com/newurl');
exit();
?>
Use application redirects when the destination depends on database data, authentication state, or business logic that is not practical in the web server. For a simple domain move, an edge or web-server rule is usually easier to audit and faster because it runs before the application starts.
Set the status that matches the situation, construct the target from trusted, validated values, and call exit() (or the equivalent in your framework) so the application does not continue rendering the old response. Preserve the path and query only when the destination understands them.
Managed edge rules versus server configuration
| Decision point | Managed edge rule | Web-server configuration |
|---|---|---|
| DNS control | Requires the old hostname’s DNS to be served through the provider and, for documented Cloudflare redirect products, proxied. | Requires DNS to resolve to infrastructure you control; no third-party proxy is necessary. |
| Access to the old origin | Can redirect even when the old site’s application is unavailable, provided the edge and DNS are working. | Needs a reachable, correctly configured Apache, Nginx, or other server. |
| Path and query handling | Dynamic expressions and a query-preservation switch make common whole-domain rules quick to deploy; complex mappings still need careful testing. | Rewrite directives and application logic offer detailed exceptions and transformations, with syntax varying by server. |
| HTTPS certificate handling | The edge must be able to terminate requests for the old HTTPS hostname; certificate and TLS settings remain a prerequisite. | Your old-host server must present a valid certificate before it can return an HTTPS redirect. |
| Rule complexity | Convenient for a hostname-wide move and visual rule management. | Better for intricate mapping tables, conditional logic, and integration with deployment configuration. |
| Observability | Usually offers edge request logs and rule-level visibility, depending on the account and product. | Provides web-server access and error logs under your operational control. |
| Recurring cost | Not stated in the available provider guidance; it depends on the service and plan. | Not stated; it depends on your hosting and operations. |
Choose the layer you can keep available for the full transition. A provider rule is useful when the old origin is being decommissioned; a server rule is preferable when you need extensive, version-controlled mappings and already operate the old host.
What’s actually slowing this PC down?
Pick the symptom - the matching free tool is one click away.
Preserve paths and queries without creating bad redirects
| Old request | New structure | Action |
|---|---|---|
/products/widget |
/products/widget |
Preserve the path and issue a permanent redirect. |
/blog/post |
/articles/post |
Add an explicit section mapping before the broad domain rule. |
/search?q=term |
The new search accepts q |
Preserve the query string. |
/old-file.htm |
No equivalent exists | Redirect to a genuinely useful replacement or, if appropriate, the new root. |
/checkout with a POST request |
The operation must remain a POST | Use a permanent 308 only if the migration is permanent and method preservation is required; otherwise design the application flow deliberately. |
A path-preserving redirect is correct only when the destination has the same meaning. Preserving a syntactically identical path is not a substitute for a content mapping.
Validate the redirect before announcing the move
Test from outside your local browser cache and inspect the response headers. A command-line check can show the status and destination:
curl -I http://old.example/
curl -I https://old.example/deep/path?x=1
curl -I https://www.old.example/
- Check the apex and
www: Request both names, or confirm that one intentionally redirects to the other. - Check both schemes: Test HTTP and HTTPS and verify that the final destination is HTTPS.
- Check representative URL shapes: Test the home page, a deep path, a trailing-slash variant, a renamed section, and a URL with a query string.
- Count the hops: Follow redirects and confirm one clean hop from the old URL to the final new URL. Remove chains such as old host to an intermediate host to the new host.
- Look for loops: A loop commonly occurs when the new hostname also matches the old-host rule, or when two systems each redirect to the other.
- Verify path intent: Compare the final content with the old resource. A technically successful 301 to an unrelated page is still a bad migration.
- Test clients that matter: Check browser navigation, an ordinary GET crawler, and any API or form workflow that uses non-GET methods.
Do not rely on a successful home-page test. Most migration errors affect only deep links, alternate hostnames, trailing slashes, or query parameters.
SEO and migration operations
Permanent redirects are signals that the new URL should replace the old one. Keep the redirect available while users and crawlers transition; the appropriate retention period depends on the migration and your operational needs, so there is no universal number of days to promise.
Quick wins for a faster PC:
Clear out junk files and repair common Windows errorsFree Scan →Scan for outdated or missing drivers - takes under a minuteDriver Scan →During a migration, update internal links, canonical declarations, XML sitemaps, feeds, and other references to use the new URLs. Submit representative old URLs to inspection tools and check that Googlebot can access the new infrastructure, as Google’s migration guidance recommends. Monitor logs for requests to unmapped old paths and add specific replacements where a real equivalent exists.
Do not use a temporary 302 merely to avoid making a decision about a completed move. Conversely, do not publish a 301 for a short campaign or test that is expected to end. The status code should describe the intended lifetime of the URL change.
Troubleshooting common failures
The browser says the site cannot be reached
Check DNS first. The old hostname must resolve to the edge or server that owns the redirect, and an HTTPS request must complete TLS before an HTTP status can be returned. Correct missing A, AAAA, or CNAME records and certificate coverage before changing redirect syntax.
The old path redirects, but the new page is wrong
Inspect the captured path and the destination template. Replace a generic host-wide rule with explicit mappings for renamed directories, files, or language prefixes. Do not preserve a path that has changed meaning.
The Tool Desk
Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Query parameters vanish
Enable query-string preservation in the provider rule or configure the server/application to carry the required parameters. Test the exact parameter names used by search and campaign links; preserving every unknown parameter is not always desirable.
There are several hops
Make the old host point directly to the final HTTPS URL. Remove intermediate HTTP-to-HTTPS, old-www-to-apex, or temporary-host hops where they can be combined. A single final destination is easier for users, crawlers, and diagnostics.
A redirect loop appears
Check whether the new host is accidentally covered by the old-host condition, whether an HTTP/HTTPS rule disagrees with the edge’s TLS mode, or whether the destination redirects back to the old hostname. Narrow the match and test each hostname independently.
Only some visitors are redirected
Compare apex versus www, HTTP versus HTTPS, and proxied versus DNS-only records. Cached DNS and edge configuration can also make different requests reach different infrastructure; verify the active rule and authoritative DNS for each hostname.
Quick Recap
A practical decision checklist
- Is the move permanent? Use 301, or 308 when preserving the original method is required.
- Is it temporary? Use 302, 303, or 307 according to whether the follow-up request should preserve the method.
- Do equivalent paths exist? Preserve the path only for those URLs.
- Do useful query parameters exist? Preserve them only when the new application supports them.
- Are apex and
wwwcovered, with HTTP and HTTPS tested? - Can the old hostname complete TLS and reach the redirect layer?
- Does every important old URL reach the final HTTPS URL in one hop?
- Have you checked logs, inspection tools, and Googlebot access during the transition?
- Will the old domain remain available for the period your users and migration operations require?
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.




