# Redirect / for non-logged in users?

**URL:** <https://meta.discourse.org/t/redirect-for-non-logged-in-users/33500>\
**Category:** Feature\
**Created:** [September 20, 2015, 5:28pm UTC](https://meta.discourse.org/t/redirect-for-non-logged-in-users/33500 "2015-09-20T17:28:33Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![JSey](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jsey/32/3540_2.png) [@JSey](https://meta.discourse.org/u/JSey)\
**Post date:** [September 21, 2015, 5:24pm UTC](https://meta.discourse.org/t/redirect-for-non-logged-in-users/33500/4 "2015-09-21T17:24:52Z")

</div>

Hm… here’s how far I got:

```plaintext
<script>
  Discourse.HomeLogoComponent.reopen({
   linkUrl: function() {
       return Discourse.getURL('/latest');
   }.property(),   
  });
</script>

```

Which works pretty well, since I get this a tag on my logo:

```plaintext
<a data-auto-route="true" href="/latest">

```

… **but:** if I click on the logo image, it takes me to `Discourse.getURL('/');` (i.e. [www.example.com](http://www.example.com) instead of [www.example.com/latest](http://www.example.com/latest)) in spite of the correct href attribute?! ~~Wut??~~ Oh.

```plaintext
  click: function(e) {
    // if they want to open in a new tab, let it so
    if (e.shiftKey || e.metaKey || e.ctrlKey || e.which === 2) { return true; }

    e.preventDefault();

    DiscourseURL.routeTo('/');
    return false;
  }

```

Really? You define a property linkUrl and override click events to a hard-coded ‘/’? 😃

Trying to figure out how to import DiscourseURL now… if anyone has hints, I will be glad…

---

_[View the full topic](https://meta.discourse.org/t/redirect-for-non-logged-in-users/33500)._
