I've got a single set up to point to /calendar on my site. the single has only one field, SEOmatic so I can add meta title, description etc.. the rest of he page is loaded with content from the photoblog channel.
The issue is that I've got things organized by months and if there are no month segments in the url I redirect to the current year and month so that for example today the site would redirect to /calendar/2016/08 and when it does this the meta tags are getting pulled from the homepage single and I don't know why.
I also have a template route set like this
If I remove the redirect code for the year/month the meta tags come through correctly, but if it's there no luck.
How can I fix this.
simplified template code here:
{% if craft.request.segment(2) == "" %}
{% redirect "/calendar/" ~ now.year ~ "/" ~ now|date("m") %}
{% endif %}
{#
// take month digit and convert to date format so we can output
// the full month name below next to the year
// if this isn't done will only output 08 or 09 for august or september etc...
#}
{% set viewMonth = '00-' ~ month ~ '-01' %}
{% set entryAfterDate = year ~ '-' ~ month %}
{% set entryBeforeDate = year ~ '-' ~ (month + 1) %}
{% set entries = craft.entries.section('photoblog').limit(null).after(entryAfterDate).before(entryBeforeDate) %}
{% for entry in entries | reverse %}
more code here
{% endfor %}
{% endblock %}
.html
?