1

i need to rewrite the url path of my href internal links. I got into my site relative and absolute links.

ex.

<a href="https://www.sitename.com/pippo" 
<a href="/pippo"
<a href="/pippo/"

I need a php function to insert inside child theme that check if an href is internal links and check the last char of url path and then if there isn't as last char the '/' apply it to internal links.

Only inside the posts and pages.

This to avoid the huge 301 redirection quantity.

Thanks for your support.

  • 1
    Where are these links located? In post content? – Krzysiek Dróżdż Aug 29 at 5:58
  • yes. in post content table wp_post – Gmac Aug 29 at 6:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.