0

I am working on a website where we have blogposts.

These blogposts have 2 custom taxonomies: subject and region.

The permalink of a blogpost looks like this:

/subject/blogpost-title

my normal blogpost archive is /subject which lists all blogposts from a certain subject (custom taxonomy). This is fine.

However my client also would like the following archive

/region/region-name/knowledge

this link should show all blogposts for the region. Via a custom rewrite I can show these blogposts on the archive page:

 $new['region/([^/]+)/knowledge/?$'] = 'index.php?post_type=post&_cat_regio=$matches[1]';

This works. But the permalink / breadcrumb of the blogposts is of course still: /subject/blogpost-title

So as soon as you click on subject in the breadcrumb you are out of the region area and back into the normal post archive.

Questions:

Would it be possible to rewrite the url of the post when under region to (so basically have an alternative permalink based on where you are)

/region/region-name/knowledge/blog-title

And 2: would this be a good idea? I know you can set the canonical url on the post so Google won't get confused. And I understand the need to show the latest blogpost for a region. But would there be a better solution?

Has anyone experience with a setup like this?

Any comments are highly appreciated!

4
  • Which one would be the canonical URL? E.g. if I call get_permalink which would be returned? You can have mulltiple URLs that go to the same place, but you need one single URL to be the canonical, authorative, defacto URL. If you do not then there are heavy SEO penalties, performance penalties, etc etc as well as semantic bugs and problems that crop up. Also you need a single question, not multiple. This isn't a discussion forum or thread, people need to be able to write an answer/solution, they can't do that if you have a collection of questions, it has to be specific
    – Tom J Nowell
    Jul 13 at 16:41
  • Hi Tom, the canonical would be: /subject/blogpost-title. (I am aware of the heavy SEO penalties, which I why I mentioned the fact that we could set the canonical link for a post). The question was - would it at all be possible to change the permalink to /region/region-name/knowledge/blog-title when the post is located on this url. And apart from that I just was hoping to hear if it was a good idea. As I myself don't think it is, and when you mention issues like performance penalties, semantic bugs etc. maybe I already have my answer. As in advice our client not to do this. Jul 13 at 17:53
  • I'm not sure what you menu by when the post is located on this URL. It sounds like your client was browsing a post via region, and clicked on a post expecting the posts URL to be in that region, only to find its permalink did not match. Is that correct? If so then it sounds like your client is trying to problem solve for you and isn't sharing their actual concern ( and you probably already have what you want, and if you visited the desired URL it would work, but it would also redirect to the canonical URL as it should )
    – Tom J Nowell
    Jul 13 at 18:28
  • Hi Tom, yes that is correct he expected the url to be in the region. I am going to leave the permalink structure as it is. I am sorry this wasn't a clear question. Thanks for your time and answers! Jul 14 at 8:12

Your Answer

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

Browse other questions tagged or ask your own question.