Redirection New Update Breaks mod_rewrite Rules
-
Hello,
After updating to Redirection newest version Version 4.5 our mod_rewrite rules in place breaks the site. See error below:
Fatal error: Uncaught ArgumentCountError: Too few arguments to function WordPress_Module::redirect_canonical(), 1 passed in public_html/wp-includes/class-wp-hook.php on line 290 and exactly 2 expected in public_html/wp-content/plugins/redirection/modules/wordpress.php:40 Stack trace: #0 public_html/wp-includes/class-wp-hook.php(290): WordPress_Module->redirect_canonical(‘https://www.dru…’) #1 public_html/wp-includes/plugin.php(206): WP_Hook->apply_filters(‘https://www.dru…’, Array) #2 public_html/wp-includes/canonical.php(597): apply_filters(‘redirect_canoni…’, ‘https://www.dru…’, ‘https://www.dru…’) #3 public_html/wp-includes/class-wp-hook.php(288): redirect_canonical(‘https://www.dru…’) #4 public_html/wp-includes/class-wp-hook.php(312): WP_Hook->apply_filters(NULL, Array) #5 public_html/wp-includes/plugin.php(478): WP_Hook->do_action(Array) #6 public_html/wp-includes/template-loader.p in public_html/wp-content/plugins/redirection/modules/wordpress.php on line 40
There has been a critical error on your website.
We disabled the mod_rewrite rules just to test and still broke the site when requesting an URL that does not exist but has a different permalink arrangement.
For example:
Sample URL
https://www.mydomain/1477/my-catMade up URL (this should return a 404 Not Found, instead breaks the site with the errors like the ones shown above:
https://www.mydomain/dog/my-catDisabling Redirection makes the mod_rewrite rules work again and also URLs that has a misconfigure permalink path return a 404 not found.
We also have tested this on a site that has no Redirection rules from the plugin in place, still breaks the site when requesting wrong permalink structure.
For your reference here is the mod_rewrite rules rules we are using:
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !^/houses/
RewriteCond %{REQUEST_URI} ^/([Houses\>\<_\s\+\ ]|%[A-Z0-9]{2,2})+/ [NC]
RewriteRule ^[^/]+/(.*)$ houses/$1 [R=301,L,DPI,NC]
#auto-correct errant characters from Houses URLs spaces and any encoded symobls
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} ^[/]([houses\s>\+\ ]|%[A-Z0-9]{2,2}){6,} [NC]
RewriteRule ^(.*)(?:[^a-zA-Z0-9/_-]|%[A-Z0-9]{2,2})+(.*)$ $1$2 [NC,L,R=301,DPI]We are using WordPress version 5.3 with Classic Editor. PHP Version 7.1.14
Regards,
- The topic ‘Redirection New Update Breaks mod_rewrite Rules’ is closed to new replies.