Host app-ads.txt at your root domain
In your GitHub Pages repository, create a file named app-ads.txt in the repository root (the same directory as your index.html or _config.yml).
Add your app-ads.txt content to the file and commit it to the branch GitHub Pages is configured to deploy from (typically main or gh-pages).
Push the commit. GitHub Pages will serve the file at https://yourdomain.com/app-ads.txt within a few minutes.
Verify by opening https://yourdomain.com/app-ads.txt in a browser. The raw file contents should appear.
Note: If you use Jekyll, files starting with an underscore are excluded from the build. app-ads.txt does not start with an underscore, so it will be included automatically. If you have a custom build process, confirm that app-ads.txt is copied to the build output directory.
Allow the Google-adstxt crawler in robots.txt
In the repository root, create or edit robots.txt and add the following:
User-agent: Google-adstxt Allow: /app-ads.txt User-agent: * Disallow:
Commit and push. Verify at https://yourdomain.com/robots.txt.
Set up a 301 redirect (if needed)
GitHub Pages does not support server-side redirects for static files. If your custom domain uses www but the file is at the bare domain (or vice versa), configure the canonical domain in the repository Settings > Pages > Custom domain and ensure both variants resolve correctly.
For more complex redirect needs, consider using Cloudflare in front of GitHub Pages to handle redirect rules via Cloudflare Page Rules or Transform Rules.
Done setting up?
Run a free scan to confirm your app-ads.txt is reachable and correctly configured.
Using a different platform? Browse all platform guides