← All platform guides

Cloudflare Pages

Place the file in your build output directory

Host app-ads.txt at your root domain

1

Place app-ads.txt in your project's static assets directory. For most frameworks this is the public/ directory (React, Vue, Svelte, Astro) or the static/ directory (SvelteKit, Hugo). The exact directory depends on your framework and build configuration; it is the same directory where you would place favicon.ico.

2

Commit and push to trigger a Cloudflare Pages deployment. Cloudflare serves all files in the build output at the root domain path.

3

Verify at https://yourdomain.com/app-ads.txt.

Note: The file must be in the directory configured as the Cloudflare Pages build output, not in a /public subdirectory if that is not your output directory. Check your project's Build settings > Build output directory in the Cloudflare Pages dashboard if you are unsure.

Allow the Google-adstxt crawler in robots.txt

1

Place robots.txt in the same static assets directory as app-ads.txt:

User-agent: Google-adstxt
Allow: /app-ads.txt

User-agent: *
Disallow:
2

Commit, push, and verify at https://yourdomain.com/robots.txt.

Set up a 301 redirect (if needed)

1

Add a _redirects file in your static assets directory. Cloudflare Pages reads this file automatically:

/app-ads.txt  https://yourdomain.com/app-ads.txt  301
2

Alternatively, configure a redirect in the Cloudflare dashboard under Bulk Redirects or using a Page Rule.

Done setting up?

Run a free scan to confirm your app-ads.txt is reachable and correctly configured.

Run a free scan

Using a different platform? Browse all platform guides

Cloudflare Pages: app-ads.txt setup guide — AppAds Verify