Skip to content
This repository has been archived by the owner on Aug 21, 2024. It is now read-only.

Doesn't work if page exists and enabled #117

Open
amityweb opened this issue Sep 10, 2020 · 5 comments
Open

Doesn't work if page exists and enabled #117

amityweb opened this issue Sep 10, 2020 · 5 comments

Comments

@amityweb
Copy link

amityweb commented Sep 10, 2020

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 amityweb changed the title Doesn't work for Sites Doesn't work if page exists and enabled Sep 10, 2020
@iparr
Copy link
Contributor

iparr commented Feb 22, 2023

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

You're good people.

@jannisborgers
Copy link

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.

@ctangney-tulip
Copy link

ctangney-tulip commented May 2, 2024

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
Copy link

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
Copy link

@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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants