# Wildcard to match all pages on the domain and all subdomains and pages

**URL:** <https://noobish.me/t/wildcard-to-match-all-pages-on-the-domain-and-all-subdomains-and-pages/694>\
**Category:** Site Development\
**Tags:** domain-names, coding\
**Created:** [October 22, 2024, 8:34pm UTC](https://noobish.me/t/wildcard-to-match-all-pages-on-the-domain-and-all-subdomains-and-pages/694 "2024-10-22T20:34:29Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![nOObish](https://noobish.me/user_avatar/noobish.me/noobish/32/13_2.png) [@nOObish](https://noobish.me/u/nOObish)\
**Post date:** [October 22, 2024, 8:34pm UTC](https://noobish.me/t/wildcard-to-match-all-pages-on-the-domain-and-all-subdomains-and-pages/694/1 "2024-10-22T20:34:29Z")

</div>

To match both all pages on the domain and all subdomains and pages, you should use the following wildcard pattern:

text

```auto
*example.com/*

```

This pattern is versatile and accomplishes both objectives:

1. It matches all pages on the domain: The trailing `/*` ensures that all pages under the main domain are included.
2. It matches all subdomains and their pages: The leading `*` before the domain name allows for any subdomain to be matched[  
1  
 ](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/).

This wildcard pattern is particularly useful because:

- It covers the root domain ([example.com](http://example.com)) and all its pages.
- It includes all possible subdomains (like [www.example.com](http://www.example.com/), [blog.example.com](http://blog.example.com), etc.) and all pages under those subdomains.
- It’s more comprehensive than just `example.com/*`, which would only match pages on the main domain but not subdomains[  
1  
 ](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/).

It’s important to note that writing just `example.com` will not work for matching all pages and subdomains. The asterisks at the beginning and end are crucial for achieving the desired broad matching[  
1  
 ](https://developers.cloudflare.com/rules/page-rules/reference/wildcard-matching/).
