WordPress.org

Make WordPress Core

Opened 11 months ago

Last modified 11 months ago

#39279 new defect (bug)

Media gallery in WP 4.7 has incorrect permalinks for PDF's

Reported by: Marcoevich Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Media Keywords: close
Focuses: Cc:

Description

Ever since updating my site to WP 4.7, the media gallery displays incorrect permalinks for PDF's. They are not in the uploads directory, but relative to the homepage. This permalink is incorrect and will redirect to the homepage.

Example: http://image.prntscr.com/image/211cc84ebc414a64ad69a2d269ea77a4.png

Attachments (1)

211cc84ebc414a64ad69a2d269ea77a4.png (28.3 KB) - added by Marcoevich 11 months ago.
Image which clearly displays the issue

Download all attachments as: .zip

Change History (5)

@Marcoevich
11 months ago

Image which clearly displays the issue

#1 @swissspidy
11 months ago

  • Keywords close added
  • Version 4.7 deleted

Hey there,

Media files are accessible on the website like posts and pages. When your permalink structure is /%postname% and the media file is not attached to a post, http://example.com/my-media-file/ is the correct permalink for an attachment. This has been the case for quite a while.

If you want the URL for the actual file inside wp-content, have a look at the meta box on the right of the screen.

#2 @Marcoevich
11 months ago

Thank you for pointing me at the metabox. I totally missed that :)

But still, the permalink which can be seen in the attached picture is not working. When I click on it, it redirects me to the homepage instead of to the file (which I expect it would). Is that how it's supposed to work then?

#3 @joemcgill
11 months ago

Hi @Marcoevich,

That link should direct you to the attachment page (more like a post for your media item) rather than the URL for the file itself. Can you reset your permalinks and retry to make sure that the URL is being recognized by WordPress?

#4 @Marcoevich
11 months ago

It works when I set the permalink structure to it's default setting. I saw the attachment page. However when I change the permalink structure back to post name, that link doesn't work again, going back to homepage.

Last edited 11 months ago by Marcoevich (previous) (diff)
Note: See TracTickets for help on using tickets.