craft-plugin-redirect icon indicating copy to clipboard operation
craft-plugin-redirect copied to clipboard

Doesn't work if page exists and enabled

Open amityweb opened this issue 4 years ago • 5 comments

Doesn't work if the page exists and is enabled.

If its intentional to only work when there is a 404 page, I think the description needs to make it clear. Sometimes we want to redirect an existing page, but seems we have to go and disable that page and it works then.

amityweb avatar Sep 10 '20 15:09 amityweb

Thanks for posting this. It was driving me nuts working out what was happening.

You're good people.

iparr avatar Feb 22 '23 15:02 iparr

So glad I found your post, @amityweb — thanks! I have been searching for an hour and couldn’t find the reason that my redirect wasn’t working. Disabling the entry that had the source URL activated the redirect to the destination URL.

jannisborgers avatar Dec 23 '23 14:12 jannisborgers

Just wanted to chime in here. Because it is an apparent requirement that the Source URL be a disabled / deleted entry, my company seems to have hit a weird edge case.

We recently audited a few of our pages and noticed that some links were missing the href attribute. When looking at the link in the admin panel, we noticed that the path was set to a disabled entry. This disabled entry was intended to be a redirect, but because Craft detected the entry as disabled a href was not rendered on the front end.

We were able to remediate this issue by enabling then re-disabling the entry which we were attempting to link to -- @amityweb @iparr @jannisborgers for vis, should any of you encounter this

@johanzandstra it is unclear to me (and some others) what the intended functionality here is. It is possible we just did not see this in the documentation. Is the expectation that the Source URL will be a disabled / deleted page in Craft? If so, a work around would likely be needed to remediate the edge case which has been described above.

ctangney-tulip avatar May 02 '24 13:05 ctangney-tulip

Circling back because after a period of time (probable that our cache expired / refreshed) the link re-broke.

At the moment, trying to add redirects to pages of the Entry type which are disabled result in broken / circular links.

ctangney-tulip avatar May 07 '24 18:05 ctangney-tulip

@amityweb @iparr @jannisborgers @johanzandstra just checking back in --

Our team met this afternoon to do a little digging here. After some investigation, we noticed that this plugin handles redirects using URI rules. URI rules get handled after Craft checks if it's a request to an element therefore the redirect code is never reached if an enabled entry lives at that URL.

ctangney-tulip avatar May 17 '24 20:05 ctangney-tulip