How does the www redirection of the Kirby site work?

Hello,

I was just wondering how https://www.getkirby.com redirects to https://getkirby.com. I can’t see nothing in htaccess Kirby Site.

Thank you.

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:

# 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]
2 Likes

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

Servers only do what you tell them to do. :wink:

1 Like

Yap This is Right :smiley:

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

1 Like