Redirect a large number of 404 pages

I have a large number of 404’s due to a site structure design change that need redirecting.

Can someone tell me how I can do this with a pattern in htaccess

Read More
key-creative-wedding-photography/60-the-key-to-creative-wedding-photography-3/contact
key-creative-wedding-photography/090-the-key-to-creative-wedding-photography-3/contact
hayling-island-beach/img_7459-hayling-island-beach/contact
farbridge-wedding-photographers/_0287-farbridge-wedding-photographers-2/contact

Please note there is a page called ./contact

Any ideas?

Thanks!

Related posts

Leave a Reply

1 comment

  1. You can try adding these rules to the htaccess file in your document root (preferably before any other rules that you have in that file):

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

    That takes anything that ends with /contact, with at least a folder before it, and redirects it to /contact.