Answers.Body: <p>I am not a big fan of using segments for form submission pages. It's an oldschool EE habit and these are pages you don't want listed anyway so query away. Maybe just have your form success page set to <code>?m=thankyou</code> so it appends to the current url and retains the previous segments.</p>
  
  <p>In your form:</p>
  
  <pre><code>&lt;input type="hidden" name="redirect" value="?m=thankyou"&gt;
  </code></pre>
  
  <p>Your submission url's should look like:</p>
  
  <pre><code>/info/landing-page-title?m=thankyou
  </code></pre>
  
  <p>Then in your template:</p>
  
  <pre><code>{% if craft.request.getParam('m') == 'thankyou' %}
    do stuff, make sure this page is nofollow, check other segments etc.
  {% endif %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-30T00:13:46.163Z
Answers.Text: Thank you - that worked great (and yes, I'm from EE).  I was going to try to use a single form for all landing pages, but in reality it makes sense to have separate forms for tracking (plus I don't think they are going to change it that often).  I appreciate your help - this will work great!!
Answers.UserDisplayName: Todd
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-29T14:04:39.443Z
Answers.LastActivityDate: 2017-04-29T18:04:36.543Z
Answers.LastEditDate: 2017-04-29T18:04:36.543Z
Answers.UserDisplayName: AbbeyDesign
Body: <p>I'm setting up landing pages in Craft where someone can fill out a very basic form and get an eBook.  My idea was to have the form <code>/info/landing-page-title</code> submit to <code>/info/landing-page-title/thank-you</code>, where they will be given a link to download their document.  My plan was to use an if-then or switch statement in the template to check if segment(3) was populated or not.  However, I'm having a difficult time getting it to redirect to the "thank-you" for the same landing page.</p>
  
  <p>Currently I'm trying to use something like</p>
  
  <pre><code>/{{ craft.request.getSegment(1) }}/{{ craft.request.getSegment(2) }}/thank-you
  </code></pre>
  
  <p>While that will output fine on the page, the form is ignoring it.</p>
  
  <p>Any suggestions on why, or a better way to do it?</p>
  
Tags: <plugin-amforms><segments>
Title: AMForms Action URL
ThreadText: # AMForms Action URL
  
  (Asked by: username_0 on 2017-04-29)
  
  I'm setting up landing pages in Craft where someone can fill out a very basic form and get an eBook. My idea was to have the form `/info/landing-page-title` submit to `/info/landing-page-title/thank-you`, where they will be given a link to download their document. My plan was to use an if-then or switch statement in the template to check if segment(3) was populated or not. However, I'm having a difficult time getting it to redirect to the "thank-you" for the same landing page.
  
  Currently I'm trying to use something like
  
  ```
  /{{ craft.request.getSegment(1) }}/{{ craft.request.getSegment(2) }}/thank-you
  
  ```
  
  While that will output fine on the page, the form is ignoring it.
  
  Any suggestions on why, or a better way to do it?
  
  **Tags:** plugin-amforms, segments
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-04-29. Score: 3 | Accepted answer
  
  I am not a big fan of using segments for form submission pages. It's an oldschool EE habit and these are pages you don't want listed anyway so query away. Maybe just have your form success page set to `?m=thankyou` so it appends to the current url and retains the previous segments.
  
  In your form:
  
  ```
  <input type="hidden" name="redirect" value="?m=thankyou">
  
  ```
  
  Your submission url's should look like:
  
  ```
  /info/landing-page-title?m=thankyou
  
  ```
  
  Then in your template:
  
  ```
  {% if craft.request.getParam('m') == 'thankyou' %}
    do stuff, make sure this page is nofollow, check other segments etc.
  {% endif %}
  
  ```
  
  > **Comments:**
  > **username_0**: Thank you - that worked great (and yes, I'm from EE).  I was going to try to use a single form for all landing pages, but in reality it makes sense to have separate forms for tracking (plus I don't think they are going to change it that often).  I appreciate your help - this will work great!!  
  
  ---
  
  