Redirect of all page number to home page with .htaccess in wordpress

I want that all the url of the type http://www.example.com/page/x are redirected to the home page http://www.example.com, where the x could be a number from 0 to 9 and all combination of them.

Actually my .htaccess has this instructions in the WordPress section.

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Related posts

Leave a Reply

2 comments

  1. Replace your current code by this one in your htaccess

    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    
    RewriteRule ^page/[0-9]+$ / [R=301,L]
    RewriteRule ^index.php$ - [L]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    # END WordPress