# Too many redirects?

**URL:** <https://forum.getkirby.com/t/too-many-redirects/1499>\
**Category:** Questions\
**Tags:** v2\
**Created:** [July 1, 2015, 8:48am UTC](https://forum.getkirby.com/t/too-many-redirects/1499 "2015-07-01T08:48:00Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![bogus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bogus/32/484_2.png) [@bogus](https://forum.getkirby.com/u/bogus)\
**Post date:** [July 1, 2015, 8:48am UTC](https://forum.getkirby.com/t/too-many-redirects/1499/1 "2015-07-01T08:48:00Z")

</div>

Hey all,

I’ve password protected a page following the Authentification tutorial in the docs. It basically works fine but if I login to the panel (via the panel login screen) and then refresh the page chrome gives me **ERR\_TOO\_MANY\_REDIRECTS**

how come? there’s just one single redirect at the top of my template:

```
<?php if(!$site->user()) go('/') ?>

```

---

<div class="post-metadata">

**Author:** ![bogus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bogus/32/484_2.png) [@bogus](https://forum.getkirby.com/u/bogus)\
**Post date:** [July 1, 2015, 6:19pm UTC](https://forum.getkirby.com/t/too-many-redirects/1499/2 "2015-07-01T18:19:18Z")

</div>

after several attempts to solve this and after a clean install of kirby I’m still not able to get this to work. And even if it’s working in chrome, in safari it doesn’t. ☹

don’t want to blame it on the software but did anything related to users/redirects/controllers happen in 2.1 that I’m not aware of?

---

<div class="post-metadata">

**Author:** ![bogus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bogus/32/484_2.png) [@bogus](https://forum.getkirby.com/u/bogus)\
**Post date:** [July 2, 2015, 9:31am UTC](https://forum.getkirby.com/t/too-many-redirects/1499/3 "2015-07-02T09:31:57Z")

</div>

Today I tried it with a completly fresh 2.1.0 Starterkit and the standard theme to no avail ☹

can somebody reproduce the error?

---

<div class="post-metadata">

**Author:** ![texnixe](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/texnixe/32/5754_2.png) [@texnixe](https://forum.getkirby.com/u/texnixe)\
**Post date:** [July 2, 2015, 9:36am UTC](https://forum.getkirby.com/t/too-many-redirects/1499/4 "2015-07-02T09:36:51Z")

</div>

What exactly would I have to do to reproduce the problem. Download the starter kit and put the redirect at top of default.php template?

---

<div class="post-metadata">

**Author:** ![bogus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bogus/32/484_2.png) [@bogus](https://forum.getkirby.com/u/bogus)\
**Post date:** [July 2, 2015, 9:42am UTC](https://forum.getkirby.com/t/too-many-redirects/1499/5 "2015-07-02T09:42:30Z")

</div>

Nope. Follow @bastianallgeier’s [Tutorial](http://getkirby.com/docs/solutions/authentication) on authentification.

---

<div class="post-metadata">

**Author:** ![bogus](https://dub1.discourse-cdn.com/flex017/user_avatar/forum.getkirby.com/bogus/32/484_2.png) [@bogus](https://forum.getkirby.com/u/bogus)\
**Post date:** [July 2, 2015, 9:47am UTC](https://forum.getkirby.com/t/too-many-redirects/1499/6 "2015-07-02T09:47:28Z")

</div>

maybe I’ve just found the error. the redirect snippet needs to point to the login page, not home.

```
<?php if(!$site->user()) go('/login') ?>

```

instead of

```
<?php if(!$site->user()) go('/') ?>

```

which makes sense in a way. Otherwise the controller and the snippet are endlessly redirecting to each other which is detected and interrupted by the browser.

---

<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:17pm UTC](https://forum.getkirby.com/t/too-many-redirects/1499/7 "2025-02-06T17:17:09Z")

</div>

Archived on February 6, 2025, 5:17pm UTC


