# How does the www redirection of the Kirby site work?

**URL:** <https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212>\
**Category:** Questions\
**Tags:** v2\
**Created:** [February 3, 2016, 8:25pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212 "2016-02-03T20:25:49Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![anon3573533](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon3573533](https://forum.getkirby.com/u/anon3573533)\
**Post date:** [February 3, 2016, 8:25pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/1 "2016-02-03T20:25:49Z")

</div>

Hello,

I was just wondering how `https://www.getkirby.com` redirects to `https://getkirby.com`. I can’t see nothing in [htaccess](https://github.com/getkirby/getkirby.com/blob/master/.htaccess) Kirby Site.

Thank you.

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [February 3, 2016, 8:31pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/2 "2016-02-03T20:31:39Z")

</div>

The Kirby site actually uses nginx, so these rules are all in the server configuration.

For your convenience, here’s a piece of Apache `.htaccess` config you can use:

```apache
# Rewrite www.<domain> to <domain>
# Works for all domains dynamically and even works multiple times (www.www.www.<domain>)
RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule (.*) http://%1/$1 [R=301,L]

```

---

<div class="post-metadata">

**Author:** ![simon2017](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simon2017/32/7442_2.png) [@simon2017](https://forum.getkirby.com/u/simon2017)\
**Post date:** [February 3, 2016, 8:34pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/3 "2016-02-03T20:34:53Z")

</div>

I think that’s automatically but i’m not Sure

---

<div class="post-metadata">

**Author:** ![lukasbestle](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/lukasbestle/32/11437_2.png) [@lukasbestle](https://forum.getkirby.com/u/lukasbestle)\
**Post date:** [February 3, 2016, 8:36pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/4 "2016-02-03T20:36:15Z")

</div>

Servers only do what you tell them to do. 😉

---

<div class="post-metadata">

**Author:** ![simon2017](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/simon2017/32/7442_2.png) [@simon2017](https://forum.getkirby.com/u/simon2017)\
**Post date:** [February 3, 2016, 8:38pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/5 "2016-02-03T20:38:51Z")

</div>

Yap This is Right 😃

---

<div class="post-metadata">

**Author:** ![anon3573533](https://avatars.discourse-cdn.com/v4/letter/a/848f3c/32.png) [@anon3573533](https://forum.getkirby.com/u/anon3573533)\
**Post date:** [February 3, 2016, 8:39pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/6 "2016-02-03T20:39:14Z")

</div>

@lukasbestle your htaccess solution is shorter and less complexe than the one I use 😉  
Thanks for this…

---

<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:00pm UTC](https://forum.getkirby.com/t/how-does-the-www-redirection-of-the-kirby-site-work/3212/7 "2025-02-06T17:00:19Z")

</div>


