WordPress.org

Ready to get started?Download WordPress

Forums

Redirect image URL to permalink (2 posts)

  1. dean_l
    Member
    Posted 1 year ago #

    Hi All

    please help with this - can i add redirect in .thaccess file that will allow me to redirect any URL inside post that contain ".jpg" or "thumb.jpg" to a permalink - same post where that image is placed?
    Of course it should be "RedirectMatch 301"

    Full description of the issue:
    Inside my posts (lot of them) I have image that is showing up in post, but also alone as a page, well i want to send that page to parent post. So posts "website.com/post1/" will have image that can be access through browser as "website.com/post1/example1-thumb.jpg" Now I don't want google to crawl this image and rather would like to redirect "website.com/post1/example1-thumb.jpg" with 301 to "website.com/post1/". There is too many posts so I need redirect as ti could not be done manually.

    Thanks a lot.

  2. dean_l
    Member
    Posted 1 year ago #

    Please note I don't want to redirect ALL images to prmalinks, just those with certain string such as "thumb.jpg". Thanks

Topic Closed

This topic has been closed to new replies.

About this Topic