humanmade / hm-redirects

Fast and scalable redirects plugin for WordPress
29 stars 11 forks source link

"Visit" link points to the wrong site on subdirectory installations #64

Closed johnbillion closed 2 years ago

johnbillion commented 2 years ago

Steps to reproduce:

  1. Set up a Multisite installation that uses subdirectories
  2. Visit the Redirects menu on one of the subdirectory sites on the network
  3. Add a redirect from /foo and publish it (the redirect destination is not relevant)
  4. Observe that the "Visit" link for the redirect listed on the Redirects screen is relative to the main site, not relative to the current site

The problem is caused because the href attribute points to the raw "from" value, which causes the link to be a root-relative link. The link should be passed through home_url().