Laravel serves everything in the public directory before hitting the router, so a static file is the simplest approach.
Step by step
- 1 Save your key as public/a1b2c3d4e5f6a7b8c9d0e1f2a3b4c5d6.txt in your project.
- 2 Commit and deploy.
- 3 Confirm the URL loads, then click Verify.
Or add a route (routes/web.php)
Route::get('/{key}.txt', function (string $key) {
abort_unless($key === config('services.indexnow.key'), 404);
return response(config('services.indexnow.key'), 200, [
'Content-Type' => 'text/plain; charset=utf-8',
]);
})->where('key', '[A-Za-z0-9\-]+');
The key shown is an example. Yours is generated when you add the domain.
Watch out for
- Remember to include the file in your deployment artifact if you build a release zip.
Then what?
Hosting the key file proves you own the domain — it doesn't submit anything on its own. You still need something watching for changes and calling the IndexNow API with the right URLs at the right time. You can build that yourself, or let us run it for $12 a year.
Set up automatic submission