<p>In your config, you can set <code>activateAccountFailurePath</code> to something like:</p>

<p><code>'activationAccountFailurePath' =&gt; 'members/failed?access=1'</code></p>

<p>In your template, you can check for the URL parameter 'access' and 404 if it is not set.</p>

<p>Template:</p>

<pre><code>{% if craft.request.getParam('access') != '1' %}
   {% exit 404 %}
{% endif %}

{# rest of your template if parameter is available #}
</code></pre>

<p>Of course, someone could still access the page if they had the full URL with the parameter, but it should help limit access. </p>

CC BY-SA 3.0
2015-04-14T12:47:46.077Z
Yeah I was thinking that also. If this is the **only** viable option I guess that's what I'll do.
Matt V
CC BY-SA 3.0
2015-04-14T02:43:35.913Z
2015-04-14T02:43:35.913Z
Aaron Berkowitz
<p>I created a custom page for account activation failure and I'm telling Craft to route to my custom page by setting the general config setting <strong>activateAccountFailurePath</strong>. This works as expected.</p>

<p>What I'd like to do is prevent users from being able to directly navigate to the custom account activation failure page. I'd prefer this page only be displayed when Craft routes the user to it. Any suggestions?</p>

<p>Thanks</p>

<users><activation>
Prevent invalid activation page failure
# Prevent invalid activation page failure

(Asked by: username_0 on 2015-04-13)

I created a custom page for account activation failure and I'm telling Craft to route to my custom page by setting the general config setting **activateAccountFailurePath**. This works as expected.

What I'd like to do is prevent users from being able to directly navigate to the custom account activation failure page. I'd prefer this page only be displayed when Craft routes the user to it. Any suggestions?

Thanks

**Tags:** users, activation

---

## 1 answers

### Answer by username_1 on 2015-04-14. Score: 1

In your config, you can set activateAccountFailurePath to something like:
'activationAccountFailurePath' => 'members/failed?access=1'
In your template, you can check for the URL parameter 'access' and 404 if it is not set.
Template:
{% if craft.request.getParam('access') != '1' %}
   {% exit 404 %}
{% endif %}

{# rest of your template if parameter is available #}

Of course, someone could still access the page if they had the full URL with the parameter, but it should help limit access.

> **Comments:**
> **username_0**: Yeah I was thinking that also. If this is the **only** viable option I guess that's what I'll do.  

---

