A practical example would be if your website has moved to a new domain and you want to ensure that visitors using the old URL are seamlessly redirected to the new address.
Once you have selected your code, input the domain you wish to redirect from in the URL section and click on Create.
When setting up redirects, VergeCloud allows you to use patterns in Page Rule URL and variables in Redirect URL to create flexible rules that cover multiple URLs. This is especially helpful when you want to preserve the path or filename during redirection.
A pattern uses the * (asterisk) symbol to match one or more segments of the URL. Each asterisk represents a capturable variable in the incoming request.
sample.com/* matches sample.com/page, sample.com/docs/index.html, etc.*.sample.com matches any subdomain like blog.sample.com, shop.sample.comsample.com/assets/*.jpg matches image files like sample.com/assets/banner.jpgEach * in the pattern corresponds to a numbered variable that can be used in the URL input at the rewrite section. These variables are represented as $1, $2, and so on, in the order they appear.
sample.com/* with destination newsample.com/$1 means:sample.com/page → newsample.com/pagesample.com/docs/index.html → newsample.com/docs/index.html*.sample.com/* with destination $1.newsample.com/$2 means:blog.sample.com/article → blog.newsample.com/articleshop.sample.com/item/123 → shop.newsample.com/item/123?key=value) are not automatically passed to the destination.* is used in the source pattern, then no variables are available for the destination.This approach ensures that visitors are redirected to the correct equivalent location on the new domain or subdomain, preserving structure and improving user experience.
After configuring your redirect, to verify its functionality, you can open a browser and navigate to sample.com/example.html. You should be automatically redirected to newsample.com/example.html.