开发者

WordPress Media URL conflicts with Page URL

开发者 https://www.devze.com 2022-12-29 10:00 出处:网络
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 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/, wi开发者_JS百科ll 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?

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号