A trailing slash added at the end of a URL
-
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 . 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]
- The topic ‘A trailing slash added at the end of a URL’ is closed to new replies.