I have a calendar located at http://domain.com/calendar/
. This shows the current month’s events. Other months can be viewed at
http://domain.com/calendar/january/
http://domain.com/calendar/february/
- and so on
This means that at the moment (i.e. September) the URL http://domain.com/calendar/september/
is showing duplicate content to http://domain.com/calendar/
. My initial thought was to redirect users from http://domain.com/calendar/
to http://domain.com/calendar/{current-month}/
. However, this would then cause search engines to always send users to the URL for the month in which they last indexed rather than the main calendar URL.
It is not an option to disable the main calendar URL as this is linked to via literature.
What is the best way of dealing with this scenario? Should I redirect from the main URL to the specific month? If so, should this be a temporary redirect (i.e. a 302)? I suspect not as this is not really what that type of redirect is for. Or is this just something I shouldn’t worry about?
I am not concerned by adding the year into the URL at this stage.
3
Answers
I would set up my routes so that the month parameter was optional. If a user navigates to
http://domain.com/calendar/
my controller would use the current month by default. If a user navigates tohttp://domain.com/calendar/{month}/
then it would use the month provided in the url and display that month instead.Ultimately I would have a single endpoint for displaying the calendar that accepts an optional route parameter for displaying a specific month.
Here is how I would create the route using C# and Mvc:
And my route would look like:
What if you add the redirect in javascript (
<body onload="setTimeout(document.location.href=get_next_month_url_function_you_make(),10)">
) after a timeout of 10 ms, so the search engine will keep linking to /calendar/ (which you should give an appropriate timeout meta tag), and users will get redirected to the month’s detail page?I would leave your current calendar route as is at /calendar, and NOT redirect to the /calendar/year/{currentmonth} page.
For previous months you should create an archive along with the year /calendar/year/month
If you have some type of indication that the /calendar route is a unique, static route that will always contain up-to-date events (in the form of a page title, content, etc.) it can always be indexed as such in search engines.
I wouldn’t redirect from archive pages to the current calendar. You could differentiate the archive by doing something like prepending Archive: to page titles and allow it to be indexed, as it will become its own unique content the following month.