Jump to content
Sign in to follow this  
bluehash

Downloads folder inaccessible - 404

Recommended Posts

I asked this in the Opencart forums too, but looks like I mis-configured something. Unable to solve it yet. Thought I'd ask you guys for input too.
 
 
I have the latest Opencart version - 2.0.1.1
 
Visitors are unable to download a file from the below link, although it is present:
 
However the same file can be downloaded from elsewhere in the folder structure, but not the same sub-domain:
 
Both folders are 775.
 
My .htaccess probably?
 
Options +FollowSymlinks


# Prevent Directoy listing 
Options -Indexes


# Prevent Direct Access to files
<FilesMatch "(?i)((\.tpl|\.ini|\.log|(?<!robots)\.txt))">
 Order deny,allow
 Deny from all
</FilesMatch>


# SEO URL Settings
RewriteEngine On
# If your opencart installation does not run on the main web folder make sure you folder it does run in ie. / becomes /shop/ 


RewriteBase /
RewriteRule ^sitemap.xml$ index.php?route=feed/google_sitemap [L]
RewriteRule ^googlebase.xml$ index.php?route=feed/google_base [L]
RewriteRule ^download/(.*) /index.php?route=error/not_found [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !.*\.(ico|gif|jpg|jpeg|png|js|css)
RewriteRule ^([^?]*) index.php?_route_=$1 [L,QSA]

This line?

RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

I  tried removing it out, but the problem still persists. Do I have to restart apache if a change is made to .htaccess?

 

Share this post


Link to post
Share on other sites

You probably know this but those two links are not the same.

 

http://store.43oh.com/download/uploads/SDCardBoosterpack/code/Energia/SDCardTutorialWithEnergia.zip

 

http://43oh.com/wp-content/uploads/ads/SDCardTutorialWithEnergia.zip

 

I recognize the second link is as one that points directly to the file in the wordpress file structure.

 

The first link is convoluted. Is it supposed to be a symbolic link to the wordpress file structure?

 

If it is a symbolic link then you may have a mismatch on the ownership of the file structure. Are all your files owned by the user www-data (or whoever the apache user is)?

Share this post


Link to post
Share on other sites

Normally, you do not have to restart apache after editing .htaccess.

 

You usually have to refresh the cache in your browser though.

 

That said, it can't hurt to restart apache though. It's quick and painless. Usually.

Share this post


Link to post
Share on other sites

Normally, you do not have to restart apache after editing .htaccess.

 

You usually have to refresh the cache in your browser though.

 

That said, it can't hurt to restart apache though. It's quick and painless. Usually.

Thanks zeke. I removed the line 

RewriteRule ^download/(.*) /index.php?route=error/not_found [L]

Restarted apache( one line anyway ), cleared cache. It's working now. :)

Thanks for lending a hand.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×