# Serving a plaintext file from the root of a ghost site

**URL:** <https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537>\
**Category:** Themes\
**Created:** [January 17, 2021, 10:45am UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537 "2021-01-17T10:45:21Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![cbeams](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cbeams/32/11245_2.png) [@cbeams](https://forum.ghost.org/u/cbeams)\
**Post date:** [January 17, 2021, 10:45am UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537/1 "2021-01-17T10:45:21Z")

</div>

I’m migrating a site to ghost and have certain plaintext files served from the root of the site that I wish to preserve, e.g.

- [https://example.com/pgp.txt](https://example.com/pgp.txt)
- [https://example.com/keybase.txt](https://example.com/keybase.txt)
- etc.

Is there any way to actually support this? I understand that static assets can be added to the `assets/` directory in the theme, but this does not preserve the existing url structure. I understand that custom routes can be added to load a handlebar template that contains this content, but Ghost forces trailing slashes, and errors on any attempt to upload a route without it.

Have I missed anything, or is this simply not possible?

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [January 17, 2021, 7:00pm UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537/2 "2021-01-17T19:00:00Z")

</div>

You should just be able to drop a file into the root theme folder as well 🙂

---

<div class="post-metadata">

**Author:** ![cbeams](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cbeams/32/11245_2.png) [@cbeams](https://forum.ghost.org/u/cbeams)\
**Post date:** [January 18, 2021, 6:06am UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537/3 "2021-01-18T06:06:59Z")

</div>

No, I’m afraid that doesn’t work. I did try it to be sure, but it makes sense that it doesn’t; if it did, you’d be able to request the other files in the root of the theme such as the README file and \*.hbs template files.

---

<div class="post-metadata">

**Author:** ![vikaspotluri123](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/vikaspotluri123/32/24_2.png) [@vikaspotluri123](https://forum.ghost.org/u/vikaspotluri123)\
**Post date:** [January 18, 2021, 7:29am UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537/4 "2021-01-18T07:29:06Z")

</div>

Ghost only blocks [certain extensions](https://github.com/TryGhost/Ghost/blob/8799feb8016fb2a913758955e0df91672c5d580c/core/server/web/site/middleware/static-theme.js), so you’re actually able to upload txt files. I just tried it on a local installation and it works:

![screenshot of a terminal showing the contents of test.txt show up in ghost/test.txt](https://us1.discourse-cdn.com/flex015/uploads/ghost2/original/2X/a/a577a6b78a197fcab97ade696f153fd5b0db97fd.png)

As suggested in this thread, have you tried in incognito or using curl to prevent browser caching?

> [@Trying to add a file to the theme root directory but always add slash when request](https://forum.ghost.org/t/trying-to-add-a-file-to-the-theme-root-directory-but-always-add-slash-when-request/8378):
>
> Hi, I’m using ghost 2.19.3. Let’s suppose my domain is example.com. I am trying to add ads.txt to the root directory, like example.com/ads.txt. I add this file to the root directory of the theme as well as another file ad.txt. After restart ghost, I can get ad.txt by visiting example.com/ad.txt but can’t get ads.txt by example.txt/ads.txt which will be redirected to example.txt/ads.txt/. The only difference is before I restarted ghost, I tried to access ads.txt but not ad.txt. I tried to clear …

---

<div class="post-metadata">

**Author:** ![cbeams](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/cbeams/32/11245_2.png) [@cbeams](https://forum.ghost.org/u/cbeams)\
**Post date:** [January 18, 2021, 7:34am UTC](https://forum.ghost.org/t/serving-a-plaintext-file-from-the-root-of-a-ghost-site/19537/5 "2021-01-18T07:34:51Z")

</div>

Thanks so much for following up. I just tried again, and indeed a test.txt file at the root of the theme does work as expected. I’m not sure now what made me believe it didn’t before.
