Now it is possible to apply rules and redirect easily subdomains or main domains, to different subdomains, main domains or even specific directories.
We use fnmatch() style pattern in order to make it easier to apply the redirects to domains and subdomains.
fnmatch() compares a single file name against a pattern.
For example:
subdomain[1-3] will match subdomain1,subdomain2,subdomain3, but it won't work for subdomain,subdomain4
In practice, www[1-3].example.com will be redirected to:
- www1.example.com
- www2.example.com
- www3.example.com
However, www.example.com and www4.example.com will not be included.
You can use also wildcards, setting *.example com:
- blog.example.com will be redirected
- www.example.com will be redirected
You can also use the rules for directories:
- example.com/www[1-3]
- example.com/*