Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2013-06-03 12:23:06
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
/section/title --> /date/title 301 redirect
Hello!
At the moment web site is using/section/title schema for URLs, but we’re considering to switch it to /year/month/day/title schema.
Any idea how to do 301 redirects non-manually?
I understand that doing vice versa, iow. /date/title/ —> /section/title would not be hard with some simple regex…
What do you think which schema is better SEO-wise?
Offline
Re: /section/title --> /date/title 301 redirect
gour wrote:
What do you think which schema is better SEO-wise?
It depends on what your content is and what your site is about.
If the section names are related to the content, then I would say that section/title URLs are better for SEO.
To my mind, date-based URLs imply content that is pertinent to a particular date and may be seen as outdated some time after it was written.
I don’t think any one scheme is definitively better than another for SEO as it is too dependent on what your content is.
Offline
Re: /section/title --> /date/title 301 redirect
I think that section/title is better but if you still wish to change maybe zem_redirect should be of help
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: /section/title --> /date/title 301 redirect
I too find section/title better but that’s probably because i never have enough content to fill every day up with stuff!
Bear in mind that Textpattern can actually do date-based archives out of the box without changing permlink scheme with the sneaky ?month=
attribute. Try viewing a section landing page with a bunch of articles on it, then add ?month=2013
to the URL. Notice that only articles from 2013 show up? Now try ?month=2013-03
and you’ll only see March 2013 articles. You can add a day too if you like.
In this way, and with some txp:if_different magic you can actually do dual-views of your content, organised in different ways. And if you don’t like the messy URL syntax, gbp_permanent_links or a bit of htaccess wizardry should be able to tidy things up so you can translate site.com/section/2013/03/24
into the relevant messy URL behind the scenes. With a bit of canonical goodness you can prevent double-indexing.
I do have an unreleased redirect plugin which is still a little rough round the edges, but I don’t know how you’d automatically redirect old articles to new without looking up its posted date first. By simply looking at the URL, how would you know, for example, that /section/my-article
needed to go to /2013/02/24/my-article
whereas /section/your-article
might need to go to 2012/09/15/your-article
?
The plugin only works on what you can see in the URL so it might not be much use. It’s employed on the TXP magazine site so it’s production-ready, there are just a few niggly jQuery things to sort out with the drag ‘n drop on the admin side. You’re most welcome to try it out, but I don’t think it’s the right tool for the job in this case.
However, a plugin that took a URL of the form /section/title
, looked up the posted date of the article, and did a crude redirect to the new URL based on that date would work. Should be pretty simple to implement as long as you don’t publish anything too close to the DST changeover dates. In fact, I might be able to extend my redirect plugin to do something like that. Hmmmmmm…
Last edited by Bloke (2013-06-03 21:58:11)
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Online
#5 2013-06-03 22:00:59
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: /section/title --> /date/title 301 redirect
springworks wrote:
It depends on what your content is and what your site is about.
It’s site for non-profit organization which announces their public activities (lectures, seminars…) and uses blog format to write about the upcoming programs and reviewing the past ones.
If the section names are related to the content, then I would say that section/title URLs are better for SEO.
In this case, section name is simply ‘blog’.
To my mind, date-based URLs imply content that is pertinent to a particular date and may be seen as outdated some time after it was written.
Here we could say that content is somehow tied to the dates in most cases.
Otoh, wonder what to do when the content is mixed, iow. based on dates and not based?
Offline
#6 2013-06-03 22:10:21
- gour
- Member
- From: Hlapičina, Croatia
- Registered: 2013-01-17
- Posts: 124
Re: /section/title --> /date/title 301 redirect
Bloke wrote:
I too find section/title better but that’s probably because i never have enough content to fill every day up with stuff!
Well, we also do not have enough content, but had situation when the same title could be relevant for two posts and then we had to devise a new name because of that.
Bear in mind that Textpattern can actually do date-based archives out of the box without changing permlink scheme with the sneaky
?month=
attribute. Try viewing a section landing page with a bunch of articles on it, then add?month=2013
to the URL. Notice that only articles from 2013 show up? Now try?month=2013-03
and you’ll only see March 2013 articles. You can add a day too if you like.
Hmm, wasn’t aware of it. Thanks.
However, a plugin that took a URL of the form
/section/title
, looked up the posted date of the article, and did a crude redirect to the new URL based on that date would work. Should be pretty simple to implement as long as you don’t publish anything too close to the DST changeover dates.
Yes, I was thinking about that ‘cause posted date is somehow known to the TXP. :-)
In fact, I might be able to extend my redirect plugin to do something like that. Hmmmmmm…
That would be interesting…but let’s decide whether it is actually recommended to change it into new scheme?
Offline