I tried to access my website recently and I saw something disturbing -- users could download the index.php
file and see its contents, the PHP code!
How is this possible, for Apache to serve up PHP source instead of running the PHP source code? Is it because we were updating our website for maintenance?
I used this code:
ErrorDocument 503 "Our website is temporarily closed for maintenance. It should reopen by..."
RewriteEngine On
# TO ALLOW YOURSELF TO ACCESS THE SITE NORMALLY, SET THE NEXT LINE TO YOUR IP ADDRESS.
RewriteCond %{REMOTE_ADDR} !^111\.222\.333\.444$
RewriteRule .* - [R=503,L]
Now this message appears.
But how I can make it automatically appear when this happens again?