Este contenido no está disponible en el idioma seleccionado
Trabajamos constantemente para que el contenido esté disponible en el idioma seleccionado. Gracias por tu paciencia.
How do I use .htaccess to block an IP address in Lightsail?
1 minutos de lectura
0
I want to use .htaccess rules in Amazon Lightsail to block an IP address from my Bitnami application.
Resolution
Locate the .htaccess file. Its default location for most applications is /opt/bitnami/apache/conf/vhosts/htaccess/your-application-htaccess.conf. For more information about .htaccess file locations, see Understand default .htaccess file configuration on the Bitnami website.
To block an IP address from your Bitnami application, complete the following steps:
Edit the access configuration file:
vi /opt/bitnami/apache2/conf/vhosts/wordpress-https-vhost.conf
Change AllowOverride from None to All. If AllowOverride is already set to All, then proceed to step 3:
...
AllowOverride All
...
Note: Replace example-application with your application name.
Edit the .htaccess file:
sudo vi /opt/bitnami/apache/conf/vhosts/htaccess/example-application-htaccess.conf
Note: Replace example-application with your application name.
Create a rule to block the IP address:
order deny,allow
deny from example-ip-address
Note: Replace example-application with your application name and example-ip-address with the IP address that you want to block.