• In some posts, like the sample I’m enclosing, I have direct links to .html pages In that page it is above the first image (a 360o photo) with the text “Si no ves el ícono“.
    Placing the pointer over the text you can see the URL preview. It ends in .html but following the link in browser a slash is added at the end of the URL so you get a Not Found error. Manually deleting the slash does load the new page correctly.
    All permalinks work good with a slash at the end. If I manually delete it in the browser URL it is added again after Enter…
    This site is 7 years old and those links used to work okay.
    V 5.4.2
    As I was writing this I thought a solution: add a RewriteRule line to .htaccess
    RewriteRule ^(.*)\.html\/$ $1.html [R,L]
    It fixed the issue.
    What WP changes have occurred that I now have to do this? (maybe not early, I realized today that problem, I only have a few links like those)
    Thank you

    • This topic was modified 4 years, 4 months ago by Jan Dembowski. Reason: Moved to Fixing WordPress, this is not an Everything else WordPress topic

    The page I need help with: [log in to see the link]

Viewing 1 replies (of 1 total)
  • I just set up a new sandbox site (wpsandbox.net) to test this for you, and configured the permalink to have no trailing slash (ie /%postname% ).

    On saving, WordPress respected this custom permalink. And my pages have no trailing slash when viewed in the browser. When I add a trailing slash in the browser, the page loads fine, but it redirects to the URL without the trailing slash.

    So what you’re experiencing doesn’t seem to be universal.

Viewing 1 replies (of 1 total)
  • The topic ‘A trailing slash added at the end of a URL’ is closed to new replies.