
Redirecting a web page to another URL is a common task for website owners, marketers, and developers. You might be moving content to a new domain, pointing a campaign link to a landing page hosted elsewhere, consolidating multiple websites, or forwarding a short vanity URL to a longer address. Done correctly, a redirect is invisible to users and preserves search engine rankings. Done incorrectly, it can cause broken links, lost traffic, and security warnings. This guide explains how to redirect a web page to another URL using reliable methods and best practices.
Reliable Migrations and Redirects with AAMAX.CO
Cross-domain redirects and website migrations require careful planning to protect search equity. AAMAX.CO is a full-service digital marketing company offering web development, digital marketing, and SEO services worldwide. They create detailed URL mapping plans, implement server-level redirects, and monitor results after launch. Combined with their website development expertise, they help businesses move domains or restructure sites without sacrificing visibility.
Internal vs. External URL Redirects
Redirects can point to a URL on the same domain or to a completely different domain. Internal redirects are typically used when restructuring a site, while external redirects are used for domain changes, partnerships, or campaign tracking. The implementation methods are similar, but external redirects require including the full URL, including the protocol, such as https://.
Choosing the Correct Status Code
- 301: Permanent move. Best for domain migrations and permanent URL changes.
- 302: Temporary move. Use for short-term campaigns or testing.
- 307: Temporary move that preserves the HTTP method.
- 308: Permanent move that preserves the HTTP method.
Using the right code helps search engines decide which URL to index and rank.
Redirecting with Apache
In your .htaccess file, redirect a single page to an external URL:
Redirect 301 /old-page https://www.newdomain.com/new-page
To redirect an entire domain while preserving paths, use mod_rewrite:
RewriteEngine OnRewriteRule ^(.*)$ https://www.newdomain.com/$1 [R=301,L]
This sends every request on the old domain to the matching path on the new domain.
Redirecting with Nginx
For a single page, use a location block with a return statement:
location = /old-page { return 301 https://www.newdomain.com/new-page; }
For an entire domain, create a server block for the old domain:
server { server_name olddomain.com; return 301 https://www.newdomain.com$request_uri; }
Redirecting with DNS and Domain Forwarding
Many domain registrars offer domain forwarding, which redirects an entire domain to another URL without needing hosting. In your registrar's dashboard, find the forwarding option, enter the destination URL, and select a permanent or temporary redirect. Services like Cloudflare also offer Redirect Rules that work at the network edge, providing fast and flexible redirects with HTTPS support.
Redirecting on Modern Hosting Platforms
Platforms like Vercel and Netlify support redirects to external URLs through configuration files. In vercel.json, you can specify a source path and an absolute destination URL with a permanent flag. On Netlify, add a line like /old-page https://www.newdomain.com/new-page 301 to your _redirects file. Frameworks such as Next.js also allow external destinations in their redirect configuration.
Client-Side Redirect Options
When server access is not available, you can use a meta refresh tag or JavaScript:
- Meta refresh:
<meta http-equiv="refresh" content="0; url=https://www.newdomain.com/new-page"> - JavaScript:
window.location.replace("https://www.newdomain.com/new-page");
These options work for users but are less efficient and less reliable for search engines than server-side redirects.
SEO Steps for Domain Migrations
When redirecting an entire site to a new domain, follow these steps to protect rankings:
- Create a complete URL map from old pages to their new equivalents.
- Implement one-to-one 301 redirects rather than sending everything to the homepage.
- Verify both domains in Google Search Console.
- Use the Change of Address tool to notify Google.
- Submit a new sitemap for the new domain.
- Keep redirects active for at least a year, ideally permanently.
Security Considerations
Always redirect to HTTPS URLs to protect users and avoid browser warnings. Avoid open redirect vulnerabilities in your application code, where attackers could manipulate a parameter to send users to malicious sites. Validate destination URLs and maintain an allowlist of trusted domains when redirects are generated dynamically.
Testing Your Redirect
Test redirects in a private browser window and with tools such as curl -I or online redirect checkers. Confirm the correct status code, the final destination, and the absence of chains or loops. Monitor analytics and Search Console after implementation to ensure traffic and indexing transfer smoothly.
Tracking Redirected Campaign Traffic
When you redirect marketing links to another URL, you still want to know where visitors came from. Preserve query strings in your redirect rules so UTM parameters reach the destination page intact, and confirm that your analytics platform records them correctly. If you use short vanity URLs on printed materials or podcasts, give each one a unique campaign tag. This approach lets you measure the performance of every channel while still sending visitors to a single, optimized landing page.
Conclusion
Redirecting a web page to another URL is essential for domain changes, campaigns, and site restructures. Server-side redirects with Apache, Nginx, hosting platforms, or edge services provide the best performance and SEO results, while client-side options serve as a fallback. With careful planning, correct status codes, and thorough testing, your redirects will guide users and search engines exactly where they need to go.