Although undocumented, according to this answer How do I force a 301 http status code using the redirect tag? 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?


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?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.