# Serve a page on its own domain in Kirby 2

**URL:** <https://forum.getkirby.com/t/serve-a-page-on-its-own-domain-in-kirby-2/22421>\
**Category:** Questions\
**Tags:** v2\
**Created:** [May 26, 2021, 2:19pm UTC](https://forum.getkirby.com/t/serve-a-page-on-its-own-domain-in-kirby-2/22421 "2021-05-26T14:19:10Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ErVal](https://avatars.discourse-cdn.com/v4/letter/e/edb3f5/32.png) [@ErVal](https://forum.getkirby.com/u/ErVal)\
**Post date:** [May 26, 2021, 2:19pm UTC](https://forum.getkirby.com/t/serve-a-page-on-its-own-domain-in-kirby-2/22421/1 "2021-05-26T14:19:10Z")

</div>

I am sorry if this has been asked before.  
I have only been able to find solutions for Kirby 3 and I am unsure whether any of those could work for Kirby 2 as well.

I’d like to have a subdomain render a page / specific content folder for a kirby 2 project.

Essentially have [bananas.example.com](http://bananas.example.com) display what would normally be on [example.com/sub/bananas](http://example.com/sub/bananas)  
and have [example.com/sub/bananas](http://example.com/sub/bananas) redirect to [bananas.example.com](http://bananas.example.com).

Is there a way to make it work automatically for all subdirectories of [example.com/sub](http://example.com/sub)?

So that if I ever decide to create a [example.com/sub/eggplant](http://example.com/sub/eggplant), it would also redirect to [eggplant.example.com](http://eggplant.example.com) without my doing anything else and have [eggplant.example.com](http://eggplant.example.com) render what would normally be displayed on [example.com/sub/eggplant](http://example.com/sub/eggplant).

The redirection from a subdirectory to the subdomain is done via htaccess, as far as I can tell.

My idea was that I might be able to do that via server or DNS settings in some way,  
but unfortunately I don’t have that kind of access to my customer’s server.

---

<div class="post-metadata">

**Author:** ![Adspectus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/adspectus/32/189_2.png) [@Adspectus](https://forum.getkirby.com/u/Adspectus)\
**Post date:** [May 26, 2021, 7:58pm UTC](https://forum.getkirby.com/t/serve-a-page-on-its-own-domain-in-kirby-2/22421/2 "2021-05-26T19:58:31Z")

</div>

Not with DNS but either server settings or in .htaccess of [example.com](http://example.com) you could redirect sub/(\*) to $[1.example.com](http://1.example.com)

---

<div class="post-metadata">

**Author:** ![distantnative](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/distantnative/32/11319_2.png) [@distantnative](https://forum.getkirby.com/u/distantnative)\
**Post date:** [February 6, 2025, 5:22pm UTC](https://forum.getkirby.com/t/serve-a-page-on-its-own-domain-in-kirby-2/22421/3 "2025-02-06T17:22:58Z")

</div>


