The essence of the issue: Wordpress generates duplicate pages in a large number of the form http://site.ru/post/68765468765/ (at the end arbitrary numbers), there are already a thousand pages in the index and it’s okay to fix it with your own hands. you need an automatic 301 redirect of such pages to the main page http://site.ru/post/ There is a nuance: the site contains third-level pages only for news and look like http://site.ru/news/post/

    2 answers 2

    Here are the rules for automatic redirect:

    RewriteEngine On RewriteCond %{REQUEST_URI} ^/post/\d+/$ RewriteRule ^(.*)$ /post/ [R=301,L] 
    • There are a lot of posts, for every such writing? - Snow
    • @donkey, rude is not necessary. Based on the text of the question, it cannot be unambiguously stated whether this problem is observed for all second-level pages or only those belonging to the post section. In addition, it is not explicitly stated that it is necessary to remove duplicates for all pages of the second level. In order not to do extra work and do no harm, I decided to answer exactly the author's question without inventing too much. - VenZell
     RedirectMatch /(.*)[0-9]+/ http://example.com/$1 

    For example, you can cut the numbers at the end of the url