In my Drupal 8 site, the install.php file is accessible.
How can I restrict the access to that file?
In my Drupal 8 site, the install.php file is accessible.
How can I restrict the access to that file?
In apache vhost:
RedirectMatch 403 "/(install|update).php"
Or in htaccess change the part on top:
# Protect files and directories from prying eyes.
<FilesMatch "\.(engine|inc|info|install|make|module|profile|test|po|sh|.*sql|theme|twig|tpl(\.php)?|xtmpl|yml)(~|\.sw[op]|\.bak|\.orig|\.save)?$|^(\.(?!well-known).*|Entries.*|Repository|Root|Tag|Template|composer\.(json|lock)|web\.config)$|cron\.php|install\.php|update\.php|^(CHANGELOG|COPYRIGHT|INSTALL.*|LICENSE|MAINTAINERS|README|UPDATE).txt$|^#.*#$|\.php(~|\.sw[op]|\.bak|\.orig|\.save)$">
Please note this htaccess also protects access to cron.php, update.php, web.config and txt files like /core/CHANGELOG.txt
How come you need it gone, is it necessarily a problem? Once the site is installed you just see a message informing you the installation is done.
If you really want it gone then once your site is installed delete the install.php file from the core directory. And then do that every time you update Drupal core