Your website may need to be moved. This could be due to domain change, traffic rerouting, promotional landing page A/B testing, or site maintenance.
But how can you ensure everything goes smoothly? How do you give every user a great experience? How can you prevent the SERP rankings for your website from declining? Moving your site is already stressful enough without annoying 404 problems for your users.
Let’s look deeper at wildcard redirection and other methods for a smooth site relocation.
What does Wildcard redirect mean?
Wildcard redirects can move all traffic from one domain to another. This is useful for redirecting all traffic from one subdomain to another or switching domains.
This URL redirection, a “catch-all subdomain” or “wildcard subdomain,” delivers users to your website regardless of the subdomain they entered, eliminating the need to create separate directories for each possible variant.
You can also use wildcard redirect to send visitors whose subdomain wasn’t spelled correctly, didn’t exist, or was randomly chosen to a working page on your site. This is usually done via a wildcard DNS record, which helps in matching user requests for domains that are non-existent.
Some of its limitations of wildcard redirect
- Separate subdomains will supersede your wildcard if you decide to create them.
- Only the A, CNAME, URL redirect, AAA, TXT, and MX record types can be used as catch-all (wildcard) records. They are unable to use NS records in any way.
- It does not override already existing records.
- Root domains are not included in a DNS record.
- More 301 redirects put unnecessary load on the server and reduce speed.
Why do we use wildcard redirect?
Here are some of the major reasons why wildcard redirects are used:
- Website Restructuring
Wildcard redirects can help ensure that all old URLs are successfully redirected to their new URLs after a website makeover or URL naming change. This prevents broken links and maintains SEO rankings.
- Content Consolidation
Consider combining many pages or sections of your website that cover the same subject matter or have redundant material into one page. The old URLs can all be redirected to the new consolidated URL using wildcard redirects.
- Handling Dynamic URLs
Employing wildcard redirects, websites that use dynamic URLs with parameters or session IDs can produce both user- and search-engine-friendly URLs. Using a wildcard redirect.
Example
A URL like “example.com/product.php?id=123” may be diverted to “example.com/products/123“.
- Handling Errors
Utilizing wildcard redirects, websites that use dynamic URLs with parameters or session IDs can produce user- and search-engine-friendly URLs. Using a wildcard redirect.
Example
A URL like “example.com/product.php?id=123” may be diverted to “example.com/products/123“.
Other uses
- They are also utilized for moving files from one folder to another during website restructuring.
- You want to create a vanity URL.
- They move files from one folder to another during website reconstruction.
- If you’ve acquired a firm whose domain points to your website, you can set up a wildcard redirect to route all traffic through yours.
What is a wildcard SSL certificate?
This certificate secures the user’s browser and your website. Additionally, a single certificate can secure an infinite number of principal subdomains. You’ll spend less on SSLs if you don’t need them for all the weird subdomains.
How to use cPanel’s wildcard redirect feature?
cPanel can send traffic from one domain to another. This can be done at domain and website levels (example.com to example. co). It’s critical to understand that when configuring a redirect in cPanel, the .htaccess file instantly receives a redirect rule.
How to do wildcard redirect in WordPress?
- You must first visit the. htaccess file to redirect your WordPress website.
- Navigate to your WordPress site’s root folder. FTP or the File Manager in your cPanel can be used for this.
- Navigate to your .htaccess file once there.
- Create a backup of your .htaccess file before making any modifications.
- Then, you can make the required changes
For more, please watch this video
What are a few examples of Wildcard redirects?
We’ve included a few illustrations to help you understand how to use wildcard redirect correctly:
Redirect all pages from one domain to another
| RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [NC] RewriteRule ^(.*)$ http://newdomain.com/$1 [R=301,L] |
Redirect all pages with a specific file extension to a new location:
| RewriteEngine On
RewriteRule ^(.+)\.html$ http://example.com/newlocation/$1.html [R=301,L] |
Redirecting files to SSL
Note: If you recently added an SSL certificate, you must create 301 redirects to your website that will switch all HTTP traffic to HTTPS. This prevents duplicate material and guarantees that your visitors access a secure site.
| RewriteEngine on
RewriteCond %{HTTP} off RewriteRule ^(.*)http://%{REQUEST_URI} [L,R=301] |
Old domain to a new domain redirecting
| RewriteEngine on
RewriteCond %{HTTP_HOST} ^abc.com [NC,OR] RewriteCond %{HTTP_HOST} ^www.abc.com [NC] RewriteRule ^(.*)$ http://abc.co/$1 [L, R=301,NC] |
Redirect URLs with a specific keyword to a new page
| RewriteEngine On
RewriteCond %{REQUEST_URI} keyword RewriteRule ^(.*)$ http://example.com/newpage [R=301,L] |
Redirect all URLs to a specific landing page
| RewriteEngine On
RewriteRule ^(.*)$ http://example.com/landingpage [R=301,L] |
End Note
It’s not simple to transfer your domain or website. It must be done properly and intelligently to avoid losing visitors or impacting your Google ranking. Using wildcard redirection is an excellent way to handle indefinable subdomain requests from users and guarantee that they see the right and legitimate web pages. Most significantly, wildcard SSL certificates will maintain the security of your website, particularly following a wildcard subdomain redirect.

