Support » Fixing WordPress » uploading PDF to root directory

  • I tried uploading a PDF to the root directory of my site but when I try to open the url at www.mysite.co/pdf-file.pdf I get a 404 error. I realize I can upload the file using the WordPress media manager and then access the file at: www.mysite.com/wp-content/uploads/2015/12/pdf-file.pdf/ but I was wondering why it’s not possible to upload it directly to the root directory.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Downloading files in the root folder shouldn’t be a problem. Have you tried accessing other files like robots.txt or license.txt from the root?

    There may be a rule in your .htaccess file that restricts access to certain file extensions. Can you take a look at its contents?

    Another thing to check are the permissions for the file. In the FTP program I use I can right click a file and select file permissions. I’m then told the permissions for owner, group, and public. For testing, set the file to 644 and try downloading it again.

    Thread Starter jrcollins

    (@jrcollins)

    I can access the robots.txt file and the file permissions for the PDF are already set to 644 so I think it must have something to do with the .htaccess file.

    I was also wondering why I sometimes get my theme’s 404 page and sometimes the hosting company’s 404 page?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘uploading PDF to root directory’ is closed to new replies.