URL redirects are commonly used when moving content, changing domain names, consolidating websites, or directing visitors to updated pages. Instead of making changes on the origin server, VergeCloud allows redirects to be configured directly through Page Rules.
This feature helps ensure that visitors and search engines are automatically directed to the correct destination URL. Redirects can be configured for individual pages, entire directories, subdomains, or even full domain migrations. Depending on the use case, you can choose between permanent and temporary redirect types while preserving existing URL structures.
To begin, navigate to the Page Rules section of your VergeCloud CDN service and select Add New Rule.
A common example is when a website moves to a new domain and traffic needs to be redirected from the old URL to the new one. Instead of updating every external link, a redirect ensures visitors automatically reach the correct destination.
Another common use case is redirecting HTTP traffic to HTTPS. This helps ensure visitors always access the secure version of a website. Redirects are also frequently used during website redesigns, where existing URLs need to continue working even after content has been reorganized or moved to a different location.
When creating a redirect rule, configure the following options:
Enter the URL or URL pattern that should trigger the redirect.
Select Redirect from the available rule actions.
Enable the rule and choose one of the following redirect status codes:
Once you have selected the appropriate status code, enter the destination URL and click Create to save the rule.
A 301 redirect indicates that a URL has permanently moved to a new location.
This status code informs search engines that the new URL should replace the old one in their index. It is typically used during domain migrations, permanent URL changes, or website consolidations.
Use a 301 redirect when:
If the change is only temporary, consider using a 302 redirect instead.
A 302 redirect indicates that content has been temporarily moved to another location.
Search engines generally continue indexing the original URL because the redirect is not considered permanent.
Use a 302 redirect when:
A 307 redirect is similar to a 302 redirect but preserves the original HTTP request method.
For example, if a client sends a POST request, the redirected request remains a POST request. This behavior is important for APIs, form submissions, and applications that rely on specific request methods.
Use a 307 redirect when preserving the original request method is required.
VergeCloud supports wildcard patterns and variables, allowing a single Page Rule to handle multiple URLs.
This is particularly useful during website migrations or when redirecting large sections of a website without creating individual rules for every page.
A pattern uses the * (asterisk) wildcard to match one or more segments of a URL. Each wildcard can capture part of the incoming request and make it available for use in the destination URL.
Examples:
sample.com/*
Each wildcard in the source pattern creates a numbered variable that can be used in the destination URL.
Variables are referenced as:
$1
$2
$3
The numbering follows the order in which wildcards appear in the source pattern.
This approach helps preserve the existing URL structure after a domain migration.
This is useful when migrating multiple subdomains while maintaining the same content structure.
Wildcard-based redirects reduce the number of rules that need to be created and maintained. Instead of configuring redirects individually, a single rule can cover hundreds or thousands of URLs while preserving paths and directory structures.
Keep the following in mind when configuring redirects:
?key=value) are not automatically passed to the destination URL.*) exists in the source pattern, no variables will be available for the destination URL.When planning large-scale migrations, it is recommended to validate a small set of URLs first to ensure the redirect behavior matches expectations.
After creating a redirect rule, verify that it behaves as expected.
For example, if your configuration is:
Page Rules provide a simple way to configure URL redirects without modifying origin server configurations. Whether you're migrating to a new domain, redirecting outdated content, enforcing HTTPS, or preserving URL structures during a website migration, redirects can be configured quickly through the VergeCloud dashboard.
By combining wildcard patterns and variables, you can create flexible redirect rules that scale across large websites while ensuring visitors and search engines are directed to the correct destination.