Today, I went to my WordPress site and saw a list of files and directories, including the index.php file. What might be causing this?
I recently installed the Rank Math plugin and tried to check the sitemap, but it wouldn’t open. When I visited my site, it just showed a file list instead of loading normally. I’m not sure when this started. I quickly restored a backup, but before that, the admin page was still accessible and working fine.
Could this be a hack, or did the plugin mess up my site? I didn't check my site before installing it, don't really know what happened.
Also, if there’s an index.php file, but the server still shows a file list, why is that? Could it be an .htaccess issue? (Apache server).
thank you.
Your server has Directory Browsing enabled, which is bad for security.
Disable it in your apache settings – though this mostly depends on your hosting. [https://stackoverflow.com/a/2530404](https://stackoverflow.com/a/2530404)
This is Indeed related to your hosting/web server configuration. Have you changed the htaccess if Apache, or nginx conf ?