M
M
Matsun2017-03-20 15:31:02
CMS
Matsun, 2017-03-20 15:31:02

How to remove trailing slash in WP blog pagination?

The site has a redirect from all pages with a slash "/" at the end to addresses without it.
The problem is that when you are on the second, third pagination page
https://bankstoday.net/category/last-articles/page/3
the link to the first page has a slash at the end
https://bankstoday.net/category/last -articles/
2017-03-20_152639.png
and thus an extra 301 redirect occurs from the page with the slash to the page without the slash.
How to replace the link by removing the slash so that there are no redirects

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Igor Vorotnev, 2017-03-30
@Matsu

Firstly, on the contrary, I would add slashes to pagination. Read this thread , especially the comments (plus there are a lot of links there). Here is one of the quotes:

Summary:
If it ends with / it can never be a file. No server guessing.
Slash or no slash are entirely different meanings. There is a technical/resource difference between "slash or no slash", and you should be aware of it and use it accordingly. Just because the server most likely loads /dvd/index.htm - or loads the correct script stuff - when you say /dvd: It does it, but not because you made the right request. Which would have been /dvd/.
Omitting the slash even if you indeed mean the slashed version gives you an additional HTTP request penalty. Which is always bad (think of mobile latency) and has more weight than a "pretty URL" - especially since crawlers are not as dumb as SEOs believe or want you to believe ;)

Pay attention to the last sentence, and pass it on to the SEOs who came up with this nonsense 10 years ago.
Well, if no one will listen to you, and you still need to remove the slash - go to the permalink settings and remove it at the end of the URL. See here .

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question