Moderator
t-p
(@t-p)
Are you sure it’s the trailing slashes causing redirects? It’s usually the other way around, the lack causes WP to redirect to with. In that case, IMO it’s better to include trailing slashes everywhere than to try and fight it.
Not sure where you got the idea a trailing slash was wrong–as it is the correct thing to do.
Do this quick test, presuming you have a Search feature on your site/theme. Search for anything and see what happens without a trailing slash. Will be interesting to know the results and how WordPress handles it.
Thread Starter
Slavek
(@jackoneill)
This will be a replacement of an original website that doesn’t use trailing slashes. And for SEO reasons (https://ahrefs.com/blog/trailing-slash/) I need to keep it like that. Google now indexes all of the URLs without trailing slash.
This is the staging website http://test.adeon.cz/ and this is the original one https://www.adeon.cz/.
But correct me if I’m thinking about it wrong.
Use trailing slashes consistently within WP. Any requests without will get a 301 redirect. Google will eventually update its data to match. Any page rank juice for old links without will get transferred to the 301 destination. It’s very much like what happens when you change a page’s name. As long as there’s a proper 301 redirect, the change will eventually be reflected in search results, but it’ll take some time. In the mean time the redirect visitors get is pretty much seamless.
Hallo, there! @bcworkz @jackoneill
My problem is the opposite of this topic.
Maybe you know about this issue:
My permanent links with “/” at the end.
But my website generates 2 url with “/” and without “/” :
1. domain.com/category – with 301 redirect
2. domain.com/category/ – 200 OK`
I want to remove all redirect url without slash. Could you tell me how can I do it?