Forum Replies Created

Viewing 5 replies - 1 through 5 (of 5 total)
  • Confirmed, I am experiencing this issue as well. Safe Redirect Manager 1.9.3 on WordPress 5.4.1. Redirect rule settings are Redirect From: /test, Enable Regular Expressions unchecked, Redirect To: /blog, HTTP Status Code: 302 Found, Notes: empty. /test and /test/ redirect to /blog/. /test?utm_medium=test and /test/?utm_medium=test are 404. Check out https://preemptivelove.org/test/?utm_medium=test to try it out. (Future readers: I will eventually take this redirect down. Check out https://preemptivelove.org/test to confirm whether it’s still in place.)

    @nfrctennant, here is the regex recipe I use in case you find it useful (be sure to check the Enable Regular Expressions checkbox):

    Redirect From: ^\/from-path\/?(\?\S*)?$
    Redirect To: /to-path/$1

    (Ignore this next part if you’re familiar with regex. I’m including it in case you or future readers are not.)

    ^ is a starting enforcer. It ensures we don’t match /something-else/from-path.
    \/ is the backslash character (/) in regex.
    from-path is our path. If your path has a slash, remember to use \/. So from\/path to match from/path in the actual URL.
    \/? is zero or one backslashes. So we’ll match both /from-path and /from-path/.
    (\?\S*)? is zero or one of the group question mark and zero or more non-whitespace characters. This is the query string.
    $ is an ending enforcer. So we don’t match /from-path/something-else.

    $1 in Redirect To is the query string we matched. It’s available to us because we wrapped it in parenthesis.

    I recommend testing your regex. I use https://regex101.com simply because it comes up top when I search “regex tester”, ha. When putting your URLs in the tester, be sure to remove your domain because we start our regex with ^. So put /from-path?utm_medium=test and not https://domain.com/from-path?utm_medium=test.

    Hope this helps!

    • This reply was modified 4 years, 9 months ago by Taylor Gorman.
    Thread Starter Taylor Gorman

    (@taylorgorman)

    Just now circling back to this. The result of that var_dump() is object(Roots\Sage\Wrapper\SageWrapping)#1789 (2) { ["slug"]=> string(4) "base" ["templates"]=> array(2) { [0]=> string(19) "base-front-page.php" [1]=> string(8) "base.php" } } so it is a conflict with my theme framework, Sage by Roots (https://roots.io/sage/). It’s a popular framework so I’m surprised you haven’t run into this before. But if it’s modifying a global variable in a breaking way, that’s not cool. What do you recommend?

    That works perfectly, thanks Nick! Super impressed by your turnaround time, what a win for the open source community.

    Fantastic, thank you!

    Hey, could you please update this to duplicate the Genesis Featured Page header tag functionality? I want to use your plugin to directly replace Genesis’s default Featured Page widget and I can’t do that if the tags don’t match. Featured Page outputs h4.entry-title and Featured Page Advanced outputs h2.entry-title. I shouldn’t have to add custom CSS to make h2.entry-title match all h4’s on my site.

    This is what I found in genesis / lib / widgets / featured-page-widget.php, in case it helps.

    $heading = genesis_a11y( 'headings' ) ? 'h4' : 'h2';

    Thanks!

Viewing 5 replies - 1 through 5 (of 5 total)