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 I can't access any given file within the directory. When I try to access the file at .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!
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/subdirectory I can't access any given file within the directory. When I try to access the file at http://domain/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!
Share Improve this question edited Apr 13, 2017 at 12:37 CommunityBot 1 asked Aug 27, 2015 at 8:12 HendecaHendeca 1367 bronze badges 4 |1 Answer
Reset to default 0Turns 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.
.htaccess
? – TheDeadMedic Commented Aug 27, 2015 at 9:36