Answers.Body: <p>That should work fine.  I just did a test in a simple template with:</p>
  
  <pre><code>{% redirect "http://google.com" 301 %}
  </code></pre>
  
  <p>And I can see it's a proper 301 redirect.  Try clearing your browser's cache?</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-13T18:47:27.650Z
Answers.Text: The redirect function is from Yii. Documentation can be found here: http://www.yiiframework.com/doc/api/1.1/CHttpRequest#redirect-detail
Answers.UserDisplayName: Aaron Berkowitz
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-13T18:46:12.793Z
Answers.LastActivityDate: 2015-04-13T18:46:12.793Z
Answers.UserDisplayName: Brad Bell
Body: <p>Although undocumented, according to this answer <a href="https://craftcms.stackexchange.com/questions/8248/how-do-i-force-a-301-http-status-code-using-the-redirect-tag/8249#8249">How do I force a 301 http status code using the redirect tag?</a> adding a 301 parameter to the redirect tag should change the status. I am using this but am still getting a 302 status.</p>
  
  <pre><code>{% redirect entry.getChildren().first().url 301 %}
  </code></pre>
  
  <p>Should this work to create a 301?</p>
  
Tags: <redirect>
Title: Can the HTTP status be set with the redirect tag
ThreadText: # Can the HTTP status be set with the redirect tag
  
  (Asked by: username_0 on 2015-04-13)
  
  Although undocumented, according to this answer [How do I force a 301 http status code using the redirect tag?](https://craftcms.stackexchange.com/questions/8248/how-do-i-force-a-301-http-status-code-using-the-redirect-tag/8249#8249) adding a 301 parameter to the redirect tag should change the status. I am using this but am still getting a 302 status.
  
  ```
  {% redirect entry.getChildren().first().url 301 %}
  
  ```
  
  Should this work to create a 301?
  
  **Tags:** redirect
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-13. Score: 3
  
  That should work fine. I just did a test in a simple template with:
  
  ```
  {% redirect "http://google.com" 301 %}
  
  ```
  
  And I can see it's a proper 301 redirect. Try clearing your browser's cache?
  
  > **Comments:**
  > **username_2**: The redirect function is from Yii. Documentation can be found here: http://www.yiiframework.com/doc/api/1.1/CHttpRequest#redirect-detail  
  
  ---
  
  