0

I have only one image attachment per post, as featured image. Every post have just one image, featured image, and no any other image in post content.

By default URL of image attachment is:

http://www.my-site.com/category/sub-category/article-name/attachment/attachment-title

How to change it to this?

http://www.sitename.com/category/sub-category/article-name/image

or

http://www.sitename.com/category/sub-category/article-name/hd

or just

http://www.my-site.com/category/sub-category/article-name/attachment    

(Without image title at the end of url)


Usage:

I have site, image gallery, and I wish to move it from current CMS to WordPress. On old CMS I have one page with medium image on it, and one more page with same image in high resolution on it.

I will redirect old page URL with medium image on it to post URL on WordPress:

http://www.my-site.com/category/sub-category/article-name/attachment/attachment-title

Old page with full size image on it I will redirect on that shorter attachment URL. It will be much better that attachment URL is shorter, and easier for making 301 redirection, like this:

http://www.sitename.com/category/sub-category/article-name/image
or
http://www.sitename.com/category/sub-category/article-name/hd
  • Can I ask why you're trying to do this? What is the purpose? – Tom J Nowell Dec 11 '14 at 20:57
  • I am moving site (image gallery) from old CMS to WordPress. On old CMS I have one page with medium image on it, and one more page with image in high resolution on it. I will redirect old page URL with medium image on it to post URL on WP, and old page with full size image on it I will redirect on that shorter attachment URL. It will be much better that attachment URL is shorter, and easier for making 301 redirection. – Advanced SEO Dec 12 '14 at 5:44
  • If you have any more question, do not hesitate to ask. Thank you. – Advanced SEO Dec 12 '14 at 5:45
  • I revised my question, any ideas @tomjnowell? – Advanced SEO Dec 18 '14 at 17:21

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.