rankmath / seo-by-rank-math

Rank Math is a revolutionary WordPress SEO Plugin that combines the features of many SEO tools and lets you multiply your traffic in the easiest way possible :bulb: :chart_with_upwards_trend: →
https://rankmath.com
107 stars 52 forks source link

[Redirections]: saving an 'Exact' type of Source URLs strips the starting / if any #163

Open Nickbahson opened 1 year ago

Nickbahson commented 1 year ago

Describe the bug Saving an 'Exact' type of Source URLs strips the starting / if any, eg try and save /contact-us/ as a source URL, contact-us/ will be saved instead, and when exported to a .htaccess file will fail to redirect as generated under the RedirectMatch (mod_alias).

To Reproduce Steps to reproduce the behavior:

  1. Add a new redirection rule that compares with Exact, the source url should start with /.
  2. Click on Add Redirection
  3. Works as expected, but export to .htaccess file and update your site to include the new .htaccess file
  4. Disable the redirection rule from above so your website .htaccess takes control of this redirection.
  5. Redirection do not work, missing / in the begging of the source url pattern in the .htaccess file.

Expected behavior When a user visits the 'Source URL' they should be redirected the 'Destination URL' as per the .htaccess file