Issue : When opening my website, a file starts downloading

This is a very rare issue and can occur with servers which utilise OpenLitespeed or Nginx which do not properly support the rules added by certain cache/performance plugins to the .htaccess file.

If you are facing this issue, then first of all you should question yourself, whether you have added any recent cache/performance plugins on your website which made changes to your .htaccess file.

If yes, then you can do the following steps to remove the file download and then login to wp-admin to remove the newly installed incompatible plugin :

1) Open your file manager :

First of all, login to your hosting control panel, once logged in look for File Manager and open it as shown :

Inside the file manager, go to domains > chose the domain name where you are facing the issue > public_html

Now, you will see the .htaccess file.

2) Edit the .htaccess file
Double click on the .htaccess file to open the file editor and remove all of the code present in it by Ctrl + A and Backspace/Delete

Now paste the below code on the file :

# BEGIN WordPress

RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

# END WordPress

The .htaccess file should look like this now :

Now, save changes and then clear your browser cookies and cache. Refer to this article on how to clear browser cookies.

Tutorial to clear browser cookies/cache : https://support.google.com/accounts/answer/32050?hl=en&co=GENIE.Platform%3DDesktop

While clearing cookies/cache, please clear them "For all time" in the time range.

Once this is done, wait for 10-15 minutes and try to access your website. Your website should likely be working now.

You can now login to wp-admin and deactivate the plugin that you were able to identify would have caused the problem.


Thanks