I checked my WordPress theme on broken link checker website and its giving me a list of broken URLs.

See:

http://www.esmedicare.com/locations.html ( parent page: http://www.esmedicare.com/ )
http://www.esmedicare.com/laser-treatments/locations.html ( parent page: http://www.esmedicare.com/laser-treatments/ )

The links with /location.html goes to 404 page and I want to redirect these pages to their parents page. i.e. Just remove the /location.html from URL and to redirect these to their parent URL mentioned in the bracker.

I added code:

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

to my .htaccess file, now some /location.html pages are redirecting to their parent page but still not all of them.

Please solve my issue…I just want to remove the /location.html from last in the URL.

Read more here: Broken Links .htaccess issue


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: