404 / 403 error

Website URL

janetmuller.epizy.com

Error Message

Access to XMLHttpRequest at 'https://infinityfree.net/errors/403/' (redirected from 'http://janetmuller.epizy.com/images/paintings/') from origin 'http://janetmuller.epizy.com' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: Redirect is not allowed for a preflight request.

Other Information

Seems like ajax can’t access folders on the site?

Thanks!

What response do you expect to receive when you send an AJAX call to the folder? If you can explain the desired situation, we can help you achieve it.

Directory listing is disabled by default on our hosting. So if no index file exists in the folder, you’ll get a 403 Forbidden response instead. You can enable directory listing if you want, but in most cases you’ll want to have an index file instead so you can control what content is being returned.

Note that this restriction only prevents you from sending requests to the directory itself. Accessing any files within the directory should work as expected.

5 Likes

What response do you expect to receive when you send an AJAX call to the folder?
I don’t understand the question, but I’ll give context. I’m trying to get all of the image files under a folder. This used to work fine. But I’m assuming that some security thing was added to prevent such things.

Directory listing is disabled by default on our hosting. So if no index file exists in the folder, you’ll get a 403 Forbidden response instead.
Interesting. I do have an index.html file under the htdocs folder.

How would I enable directory listing?

Thank you for your time!

Add this to the .htaccess file you have to create in the htdocs/images/paintings folder:

Options +Indexes
7 Likes

That worked! Thanks!

The folders had a _DS_Store file with that option inside of it. I certainly didn’t make that file. But I created new .htaccess files with that option, worked great!

Thank you!

2 Likes

That’s a folder created by Finder, the file app on MacOS. It’s not created by the server. If you use MacOS yourself, then you may have uploaded it by accident. But you can sometimes also find it in downloads created by people who use MacOS.

On MacOS, Finder knows to hide these folders, but on every other platform they will be visible.

3 Likes

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.