I was trying to create a link that allow user to download file from my server but I got “xxx.tgz what not found on this server” error.
My code is very simple:
<a href="/var/www/ci/cilog/dir/test.tgz">test.tgz</a><br>
When I click the link, it will show the “test.tgz was not found on this server” error.
Sorry for repost this question again but none of the posted solution works for me. I tried to changed the default file in the apache2 folder but it didn’t work.
Can anyone help me out here?
Thanks.
Don’t use the path on your server in your web address. The webserver thinks a certain folder is its root, and doesn’t expose any other folders.
For example, this site is
http://stackoverflow.com/questions/13996344, not/var/www/stackoverflow/questions(I know that’s not how this site works, but it’s just an example).The path needs to be the web root, not a server path.
Assuming
/var/wwwis your webroot.Or, you can use
/to point to the root of your website: