Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2020-01-14 06:26:23

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,615
Website GitHub Twitter

zem_redirect and txp 4.8 beta

I found that when using the new /section/category/title url pattern, zem_redirect does not behave properly on the dev release. More precisely, it redirects /section/cat1/cat2/ pages to /section/cat2/ pages, which, at least in my site, they do not officially exist. zem_redirect is a smallish plugin, helping against script-kiddies trying to inject content in the websites, as well as resolving some typos in the urls. Note that all other links, including /section/cat1/cat2/title appear to be working just fine with it.

It would be a pity to lose it from our arsenal.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#2 2020-01-14 08:00:34

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,136
Website

Re: zem_redirect and txp 4.8 beta

That was one I was never very familiar with but from the infos on textpattern.org “it has no effect in messy URL mode, or on pages other than individual articles” so I guess it dumbs down your link to what it thinks is a section/title url scheme. It may be a casualty of your new url scheme and without code changes may not handle those cases well.

I’m not sure if you’re using some of its custom (undocumented) settings, but some ideas:

  • Restrict to acting in individual_article context only. That may resolve your problem if the other urls are working as expected
  • Use rel="canonical" to designate your desired “correct” link. Then it doesn’t really matter if someone reaches your page via a different url pattern, you still specify which should be the “correct” one for search engines.
  • If you have custom url redirects, maybe arc_redirect (straightforward /404-url to /my-proper-url or http://my-external-link.com redirects) or smd_redirect (includes regex patterns).

TXP Builders – finely-crafted code, design and txp

Offline

#3 2020-01-14 09:13:38

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 10,285
Website GitHub

Re: zem_redirect and txp 4.8 beta

Yes, try smd_redirect. Although you’ll need to migrate your rules, it may well be that with the regex pattern matching and rule ordering you can slim down your rule set quite a bit.

Any issues with the plugin on 4.8, please let me know. I’ve not tried it recently and would be interested to know how well it works.


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

Offline

#4 2020-01-14 09:15:52

etc
Developer
Registered: 2010-11-11
Posts: 4,259
Website GitHub

Re: zem_redirect and txp 4.8 beta

colak wrote #321074:

More precisely, it redirects /section/cat1/cat2/ pages to /section/cat2/ pages, which, at least in my site, they do not officially exist.

Exactly opposite: /section/cat1/cat2/ is your own construction, txp does not support it, while /section/cat2/ is the canonical URL of cat2 in section_category_title scheme.

Offline

#5 2020-01-14 10:25:01

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,615
Website GitHub Twitter

Re: zem_redirect and txp 4.8 beta

etc wrote #321080:

Exactly opposite: /section/cat1/cat2/ is your own construction, txp does not support it, while /section/cat2/ is the canonical URL of cat2 in section_category_title scheme.

I see! Well, I’ll have to disable the plugin as /section/cat2/ does not return the content constructed for /section/cat1/cat2/.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#6 2020-01-14 10:46:46

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,136
Website

Re: zem_redirect and txp 4.8 beta

colak wrote #321082:

I see! Well, I’ll have to disable the plugin as /section/cat2/ does not return the content constructed for /section/cat1/cat2/.

And my first suggestion – restrict it to working within the txp:if_individual_article case?


TXP Builders – finely-crafted code, design and txp

Offline

#7 2020-01-14 11:01:14

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,615
Website GitHub Twitter

Re: zem_redirect and txp 4.8 beta

jakob wrote #321083:

And my first suggestion – restrict it to working within the txp:if_individual_article case?

I’ll try it. Admittedly, up to now, i did not need to use its tags. All I needed was to just have it enabled and all was working just fine. I did a few tests and I got the unregistered tags warning. I added the registration but to no avail. It’s been years now that the plugin was working seamlessly. Furthermore, I forgot the documentation for it, and Alex’s site no longer exists, so further testing awaits me:)


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

#8 2020-01-14 11:50:00

etc
Developer
Registered: 2010-11-11
Posts: 4,259
Website GitHub

Re: zem_redirect and txp 4.8 beta

colak wrote #321074:

Note that all other links, including /section/cat1/cat2/title appear to be working just fine with it.

That’s quite normal, given that /section/cat1/cat2/title is a canonical txp article link in section_category mode. But /section/cat1/cat2/ is resolved as c=cat2, there is no notion of category 1/2 outside article context.

This said, we could introduce it, but zem_redirect wouldn’t understand it anyway without update.

Offline

#9 2020-01-14 13:23:04

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,364
Website GitHub Mastodon

Re: zem_redirect and txp 4.8 beta

colak wrote #321084:

Alex’s site no longer exists, so further testing awaits me:)

I dug into the Wayback Machine.

https://web.archive.org/web/20121028160745/http://thresholdstate.com/software/3701/zem_redirect

Unfortunately, he password protected the documentation so it never got archived.

IIRC I was a paid user but if I still have a copy of the documentation at this point I have no idea where.

Offline

#10 2020-01-14 14:25:05

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 4,136
Website

Re: zem_redirect and txp 4.8 beta

michaelkpate wrote #321093:

if I still have a copy of the documentation at this point I have no idea where.

That’s a first for you! You’re almost invincible when it comes to finding stuff! And yes, you said in the past you were a paid user.

Yiannis, here are two posts that could help.

Els: here providing a hint
Me: here learning the hard way

I proposed some edits shortly afterwards. arc_redirect definitely does from_to redirects. smd_redirect is similar and more powerful in that you can use regex for the from and has drag and drop to allow you to switch order.
You can use both for internal and external links and both have their own pane under the extension menu and no public-side tags.


TXP Builders – finely-crafted code, design and txp

Offline

#11 2020-01-14 14:57:29

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,364
Website GitHub Mastodon

Re: zem_redirect and txp 4.8 beta

jakob wrote #321094:

That’s a first for you! You’re almost invincible when it comes to finding stuff! And yes, you said in the past you were a paid user.

I am thinking the extended documentation was a word document. But I searched my Google Docs (where I store things like that now) and came up empty. I lost a hard drive back in 2010 and had most of it backed up but apparently not everything.

I do have what seems to be a copy of Redirect Pro 1.0 if anyone wants it.

Offline

#12 2020-01-14 15:18:56

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 8,615
Website GitHub Twitter

Re: zem_redirect and txp 4.8 beta

michaelkpate wrote #321095:

I am thinking the extended documentation was a word document. But I searched my Google Docs (where I store things like that now) and came up empty. I lost a hard drive back in 2010 and had most of it backed up but apparently not everything.

I do have what seems to be a copy of Redirect Pro 1.0 if anyone wants it.

No worries Michael,

I have v 1.2.1 linked already. At the moment I still have a lot of work to be done on the site, and the plugin functionality was just the cherry on the cake.

The work I am doing now is only concerned with re-structuring and once finished I will be releasing it but at the same time start with a redesign. I will also be launching a new site for my wife.


Yiannis
——————————
neme.org | hblack.net | State Machines | NeMe @ github
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB