0

I want to first point out that I have tried to solutions listed in this post and in every case it either hasn't worked or hasn't been appropriate for what I'm trying to do. I have tried several different methods from several different sites and I'm unable to find anything that works for me.

I want to link to a zip file for download. The zip file is in a subdirectory in the wordpress root. I put an empty .htaccess file in that subdirectory, and while I can see the directory index by navigating to http://domain.com/subdirectory I can't access any given file within the directory. When I try to access the file at http://domain.com/subdirectory/file.zip I get a "Page not found" response from wordpress. I also tried adding the following to the .htaccess file in the subdirectory:

<FilesMatch "\.(zip)$">
Allow from All
</FilesMatch>

I also tried adding the following above the # BEGIN WordPress section of the .htaccess file in my root .htaccess as suggested by the question linked above:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_URI} ^/mydirectoryhere/(.*)$ [OR]
RewriteRule ^.*$ - [L]
</IfModule>

Can anyone help me figure out why this is happening? I'm using custom permalinks in my Wordpress installation with the following configuration:

/%category%/%postname%

Here's the contents of my root wordpress installation directory .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

Thank you!

4
  • 1
    Are you sure the file is readable by the server? WordPress shouldn't interfere with any physical files/directories. Can you post the entirety of your .htaccess? Commented Aug 27, 2015 at 9:36
  • A ""Page not found" response from wordpress"? Are you sure it is from WordPress and not from the server itself? Exactly what is the response you see, word for word?
    – s_ha_dum
    Commented Aug 27, 2015 at 14:36
  • @s_ha_dum Sorry I realized that was an inaccurate description. I get the Wordpress 404 page for my theme. So it's showing the 404.php file in my Wordpress template. As for the exact .htaccess content, I edited it into the original question.
    – Hendeca
    Commented Aug 28, 2015 at 1:37
  • @TheDeadMedic I wanted to add that if you navigate to the directory that contains the zip file, you get an index of the directory. If you right click that .zip file and click "Save Link As..." it downloads as expected. Not sure if this helps
    – Hendeca
    Commented Aug 28, 2015 at 1:46

1 Answer 1

0

Turns out the file was the problem, as @TheDeadMedic suspected. The permissions were 640. After changing them to 644, the problem was solved!

Thanks for the help.

1
  • You can accept your answer. It will be helpful for others.
    – Hector
    Commented Dec 15, 2019 at 11:07

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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