Redirecting URL using .htaccess

I have a WordPress website and some link checker plugins are reporting all the links broken in same way. Just have a look:

http://www.esmedicare.com/category/blog/page/2/locations.html ( parent page: http://www.esmedicare.com/category/blog/page/2/ )
http://www.esmedicare.com/hello-world/locations.html ( parent page: http://www.esmedicare.com/hello-world/ )
http://www.esmedicare.com/neonatal-care-2/locations.html ( parent page: http://www.esmedicare.com/neonatal-care-2/ )
http://www.esmedicare.com/dental-center/locations.html ( parent page: http://www.esmedicare.com/dental-center/

I just want to redirect all these pages to their parent pages shown in bracket but I dont know how to do it exactly.

Read More

Please help me to solve this.

Related posts

Leave a Reply

1 comment

  1. Try adding these rules in the htaccess file in your document root, above any wordpress rules:

    RewriteEngine On
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^(.*)/locations.html$ /$1/ [L,R=301]