0

I have a page with permalink set in the dashboard to www.domain.com/reports that has links to PDF reports located in www.domain.com/wp-content. There is not a reports directory on the server and creating one in the root directory, obviously breaks the www.domain.com/reports page.

How can I change the settings and/or file structure such that the PDF links are www.domain.com/reports/<pdf document> without overriding or conflicting with the permalink?

  • Possible duplicate of wordpress.stackexchange.com/questions/14924/… – heathenJesus May 16 '17 at 22:39
  • @heathenJesus The proposed duplicate doesn't address the permalink conflict issue, does it? – Don P May 16 '17 at 22:41
  • Ah, I had thought you were trying to link to the attachment pages, not the files themselves. Is there something stopping you from just setting up an .htaccess rule to rewrite /wp-content/uploads/(.*)/ to /reports/? (or, since you're discussing putting them directly on the server, into a folder specific to those reports such as /report_files/ and likewise rewriting via .htaccess) – heathenJesus May 16 '17 at 22:57
2

I have an idea, let's see if it helps you.

You may create separate pages for each pdf file and make Reports page as parent of these pages.

Then inside the child pages, you can embed the pdf files with a PDF Reader plugin or simply using an iframe tag.

Thanks

  • Thanks for the suggestion. While that may do the trick I'm not sure it's worth the effort i my particular case. I have about 30 pdfs and will be adding to it, so it's a bit easier to just direct link to the doc itself. I wound up just creating a directory 'documents' to host the pdfs such that the links on the reports page are `domain.com/documents/<pdf document>. – Don P May 16 '17 at 22:44

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.