Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Events archive page redirect doesn't honor case-insensitive AND ignore-slash simultaneously #3895

Closed
codewizard13 opened this issue Aug 8, 2024 · 6 comments

Comments

@codewizard13
Copy link

codewizard13 commented Aug 8, 2024

Summary

I have a redirect set up for my "events" archive which I am testing in my local dev environment before pushing to STAGING. The Ignore Case Regex and Ignore Slash flags are all enabled and my redirection is set up as follows:

  • Source URL: ^/events$
  • Target URL: https://ft-prod-redirect-case-insensitive.local/events/

Expected Behavior

All cases of my events archive URL, with or without a slash should redirect to the target URL.

Actual Behavior

I performed several tests with different iterations of case for the word 'events', both with and without a trailing slash.

Findings: All cases work without a trailing slash, but with the trailing slash only lower case redirects correctly.

Redirect Results Table:

TRY# Source URL Result
1 ...local/events/ CORRECT
2 ...local/events CORRECT
3 ...local/Events/ 404
4 ...local/Events CORRECT
5 ...local/evEnts CORRECT
6 ...local/eventS CORRECT
7 ...local/eventS/ 404

404 page

Steps to reproduce

  1. Create an archive called "events"
  2. Create a new redirect in Redirection with these settings:
  • Source URL: ^/events$
  • Target URL: [yourdomain.tld]/events/
  • Enable all three flags: Ignore Case Regex and Ignore Slash. Your setup should look like the screenshot:

The events redirect configuration

  1. Clear browser cache and any site or plugins caches for good measure.
  2. Reset permalinks for good measure
  3. Perform the tests listed in the table above
  4. Observe that for /Events/ and /eventS/ they both redirect to 404s

Environment

Environment is fully up to date at time of testing (08/08/2024, 2:48 PM CST)

  • Browser Version: Chrome 127.0.6533.90 (Official Build) (64-bit)
  • WordPress Version: 6.6.1
  • Redirection Version: 5.4.2
  • OS: Microsoft Windows 11 Pro 10.0.22631 Build 22631
@codewizard13 codewizard13 changed the title Events archive page redirect doesn Events archive page redirect doesn't honor case-insensitive AND ignore-slash simultaneously Aug 8, 2024
@codewizard13
Copy link
Author

codewizard13 commented Aug 19, 2024

Hello? @johngodley. I opened this issue 2 weeks ago, and really need help with it. Am I supposed to flag this in some way with flair or a tag (label?) to get it looked at? I noticed that many others have had their issues responded to already. I have provided a clear, detailed ticket to be of the most help to you possible.

@johngodley
Copy link
Owner

This isn't a support system and there is no guaranteed response - I only have so much time to look at things. With a regular expression you are expected to perform things in the expression itself, and the flags don't apply.

@codewizard13
Copy link
Author

codewizard13 commented Aug 20, 2024

Ok, many projects use the GitHub Issues as their support methodology: Is there a support system somewhere else I should be looking at? I love your plugin, it's just got this one issue -- I even spent the time to make a detailed truth table so you would know exactly what to look at. Please advise where the appropriate support system is so that I can get somebody to evaluate this problem. I believe this may be a bug with the plugin -- an edge case, I think they call it. Also, I have tried doing everything in the regular expression with no flags applied, but got the same results. Thank you for your help

@johngodley
Copy link
Owner

You misunderstand what I mean. I am not a company, there is no support system, and there is no one else to evaluate the problem. I will look at your issue in time, but there is no queue or guaranteed response window. Your problem has more details and this means it needs more time to investigate.

@codewizard13
Copy link
Author

Ok, gotcha. No worries, I understand what it's like being a solopreneur trying to do everything yourself. Thanks for clarifying!

@codewizard13
Copy link
Author

I believe I have solved this one, so am posting the solution in case it may help anyone else. This is format your regex should take:

^(?i)/AStringInOfWords/?$

Here's what each part of the regex does:

  • ^: The redirection plugin advises you that this should always be first; means "the part after the root site url starts with this bit to the right"
  • (?i): Matches regardless of case (case insensitive match)
  • #GOTCHA: Not sure why the forward slash has to come after the case insensitive directive?
  • AStringOfWords: This is your redirect "tag" and can be anything you want. Set it in the Source URL field as whatever your desired case is, or the most common casing. Here it is in a version of "mixed case" called "title case"
  • /?: This bit at the end says match with or without a trailing slash
  • $: The dollar sign at the end says if anything else comes after this part, then don't match it. This helps prevent infinite 301 redirect loops
  • All three flags are still on: ignore case, Regex, and Ignore Slash

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

No branches or pull requests

2 participants