If I upload a file foo.pdf
to WordPress I can access it at http://example.com/foo/
. (There is a simple HTML page with a link to the PDF file).
If I then create a Page named foo
I cannot view or preview the Page because the default URL, http://example.com/foo/
, will resolve to the page for the PDF.
How can I resolve this URL conflict?
If I remember correctly, WordPress’s URL redirection uses the
-f
flag, so it applies the “nice URL” rule only if the requested file doesn’t exist. I think you could say that is the proper behaviour.The easiest way would be storing the PDF elsewhere, for example in the
/wp-content
directory that is exempt from URL rewriting. Is that not an option?