link to .exe gives 'You do not have permission to access this document' instead of downloading it - html

When trying to add a link to a downloadable .exe I encounter an error/notice:
'You do not have permission to access this document' instead of downloading it.
This is the anchor:
Here
Using this on .zip and .dmg work fine.
I've found something eslewere, suggestion to add exe|EXE and place this in the .htaccess:
Deny from all
<FilesMatch "\.(html|HTML|htm|HTM|xhtml|XHTML|js|JS|css|CSS|bmp|BMP|png|PNG|gif|GIF|jpg|JPG|jpeg|JPEG|ico|ICO|doc|DOC|docx|DOCX|txt|TXT|rtf|RTF|xls|XLS|xlsx|XLSX|csv|CSV|zip|ZIP|pdf|PDF|exe|EXE)$">
Allow from all
</FilesMatch>
This did not solve my problem, removing for example the PDF from this bit of code, did block the pdf download. But the other way around, adding the exe didn't enable the exe to be downloadable.
It is a WordPress install, but these downloads are not uploaded via WordPress, they are directly placed in the downloads folder.
Kind regards,
Martijn

After more searching, I found someone, posting a simular problem.
The suggested answer (settings with the hosting, not the actual code) there was not the solution.
But did set us on the right path.
Previously simular code was working, but on another server, with a different config.Current domain is done via the Plesk panel.
In the Plesk panel, under the Apache & nginx settings for the domain.
Checking the box: 'Serve static files directly by nginx' solved the issue for me.

Related

styles.css resource not loading when on the server, works locally

I'm new to creating webpages, so perhaps this is really easy and I just can't see it. I have a HTML/CSS template that I am modifying for a new site. When I check the index.html file locally (in Dreamweaver or in browsers) it appears correct. When I uploaded them to the server then the website does not load the images and it appears that the styles.css file is not loading correctly. I have attached a few screenshots to get the ball rolling. As always thanks for your assistance.
Desired Output:
Current Output:
This is likely (later confirmed by asker in comment) a file and directory access right problem.
This can be verified by checking the access logs of the http server.
The solution is to update the ownership and permissions of any problem files so that the http server has rights to them. In this case, it is probably the easiest to examine the permissions of the index.html file and related folders and apply the same permission to the problematic files/folders.

My website doesnt load index.html if i dont write it manually

I recently bought a website to play with, but I immediately had a problem.
My website doesn't load the index.html when I just connect to mydomain.com. If I write it manually (mydomain.com/index.html) everything works perfectly. I tried to change the .htaccess file to direct all traffic to my index.html page with the following line, but the problem remains:
DirectoryIndex index.html
Any ideas to solve the problem?
Please provide the web host and/or server type (windows, linux, etc) to help further answer your question.
As a start some web servers (windows/iis) expect different file names for the default html file. Godady.com has a list of different file names for Linux and Windows at this url: https://www.godaddy.com/help/what-file-displays-when-someone-browses-to-my-domain-name-60
Good luck!
This DirectoryIndex index.html has to be set in httpd.conf file. In your httpd.conf, you might have disabled .htaccess with AllowOverride none. That is why your .htaccess is not working

HTML and HTAccess

I have been struggling with this all morning and I have not had much luck.
I am trying to get the following stackoverflow post to work: How to remove .html from URL
Here is my file directory with the htaccess file:
Here is my code that works fine using .html
So I went into sublime text and posted the same code into a .htaccess file as shown here (also in my directory first pic):
I then changed my links and removed .html
But I get an error
If anyone could please tell me what I'm doing wrong I would be grateful! Been bashing my head on this all morning
.htaccess is a file used to control access for Apache web servers. It won't affect anything unless you're running and accessing an Apache server. From your screenshots I can see that you're directly opening a file from your hard drive.
Your browser is saying File not found because you're trying to access a non-existent file. The address bar in your browser should say this:
file:///Users/mikegeng/Documents/GitHub/MichaelGeng.github.io/index.html
.htaccess is used by Apache Webserver. You must install and configure an Apache Webserver and access your site through http://localhost for example.
Currently your .htaccess is completely ignored until your site is served by Apache.

HTML 5 GeoLocation in Google Chrome

I am using HTML 5 Geolocations API's for tracking location however I am getting the following error on the Geolocation icon in Chrome Browser
"This Page has been blocked from tracking your Location"
I went to the Preferences and Setting's Page but did not find any help.
In my case the problem was that I opened the HTML file from the file system (file:///...). Browsers generally try to prevent accessing personal information (which includes location) from local files, so you have to serve the file through a web server (even if it is local).
One simple way to serve a static website located in your filesystem is SimpleHTTPServer if you have Python installed. Just navigate to the folder using the command prompt, and say python -m SimpleHTTPServer, and then you can view the file on localhost:8000.
Even I was facing the same problem. One of the solution is to open to file in another browser, I tried in Firefox and it worked fine. Another solution is to open the file through your WAMP server (Local host).
There is a good article here about Geolocation API. You have to go to chrome://settings/content and there, you can find Location information. You should be able to find the exceptions and manage them there.

Disable viewing directory tree via url

I bought a domain name and am trying to figure out how to configure it responsibly. I haven't set up an index.html file yet and I've noticed that if I hit my domain, I see my file directory tree and I can dive down to all the files within my browser. Is there a way that I can disable this? I am hosting it on Apache
If you are using IIS.
Right-click on your website, and choose Properties.
Select Home Directory tab.
Uncheck the Directory browsing.
You can try a few things:
create an empty file named index.html and upload it into the public_folder
create an .htaccess file with the following contents: Options -Indexes
If you have some kind of cpanel for your site, look for options to disable directory browsing.
Creating the index.html file is probably the easiest and most consistent way to go.
FYI, my .htaccess info came from techiecorner.com