Redirecting /page/*/ to the home page in .htaccess

Redirecting /page/*/ to the home page in .htaccess - If a page has internal and external outgoing links to redirecting URLs, it’s returning 3xx (301, 302, etc.) HTTP status codes standing for redirection. This issue means that the page does not exist on a permanent or temporary basis. It appears on most of the popular web browsers, usually caused by a misconfigured website. However, there are some steps you can take to ensure the issue isn’t on your side. You can find more details about redirecting URLs by reading the Google Search Central overview. In this article, we’ll go over how you can fix the Redirecting /page/*/ to the home page in .htaccess error on your web browser. Problem :


My problem is that my homepage exists on https://www.example.com/page/2/, /3/, /4/ and so on, it still exists on /1000/. Same duplicate page versions exists on /about and and /contact page of my site.



Now what I want is to redirect all the https://www.example.com/page/* URLs to https://www.example.com



What code should I use on .htaccess to fix these duplicate page versions of my website?


Solution :

rule for all after /page/* redirecting to homepage:



RewriteEngine On
RewriteRule ^page/(.*)$ / [R=301,L]


or all /page/0-9+/ redirecting to homepage:



RewriteEngine On
RewriteRule ^page/(d+)/$ / [R=301,L]

We hope that this article has helped you resolve the htaccess, redirects, url error in your web browsers. Enjoy browsing the internet uninterrupted!

Comments

Popular posts from this blog

How to redirect to any domain [duplicate]

"302 found" for index page bad for SEO?

Create redirect from url like www.example.us/?p=100&option=