Broken Links .htaccess issue

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

See: ( parent page: ) ( parent page: )

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

Leave a Reply

Your email address will not be published. Required fields are marked *