I recently used Yeost SEO to redirect all my Attachments (images) to the parent post pages (image galleries).

In doing this the Attachment URLS have changed, caused me a whole host of issues!

They were https://www.obsidianurbexphotography.com/chateau-vp-hall-with-windows/

Not they have post categories etc included


Can I use htaccess rewrite rule to put them back, to just the filename without categories?

Thanks (I am a bit of a noob...)


  • You wouldn't use HTAccess rules, this is a WP rewrite rules problem, I'd recommend turning off whatever option you enabled in Yoast – Tom J Nowell May 24 '17 at 13:53
  • I recently used a rewrite in HTAcess to change the URL of my news feed posts, removed the "?news" and added "/blog/" then refreshed the permalink options in Wordpress Dashboard.. I was assuming there would be a way to do this similar thing in this case maybe? – Obsidian May 24 '17 at 14:01
  • Any idea how to do this within Wordpress as a rewrite? I think I jumped the gun here, sorry :D – Obsidian May 24 '17 at 14:09
  • What specifically do you mean by "the attachment URLs have changed?" The actual server URLs don't change when you toggle that Yoast setting. If you go into the media library you'll see they are something like https://www.obsidianurbexphotography.com/wp-content/uploads/2017/05/myfilename.jpg both with and without that setting enabled. If you want to access them through a pretty permalink you just need to turn that Yoast setting back off. – WebElaine May 24 '17 at 14:10
  • 1
    @Obsidian Have you contacted Yoast SEO support? – Tom J Nowell May 24 '17 at 14:59

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.