Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

387
Visualizações
how to enable .htaccess in AWS Lightsail LAMP module

I am new to AWS Light sail. I have successfully migrated my web application to a LAMP server(bitnami) and I generated SSL certificate. now I want to redirect to HTTP to HTTPS. Hence I created .htaccess and copied the below the code and restarted my server. but the page is not migrating from http to https. can you please help me to enable .htaccess?

since i am planning to host 3 websites, i am looking for htaccess so that i can configure locally based on the condition.

RewriteEngine On
RewriteCond %{HTTP_HOST} ^test\.in [NC]
RewriteCond %{SERVER_PORT} 80
RewriteRule ^(.*)$ https://www.test.in/$1 [R,L]

Thank you.

over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Bitnami Engineer here:

By default, we disable .htaccess files due to security and performance reasons. We also move .htaccess files content to a file called htaccess.conf in the folder /opt/bitnami/apps/APPNAME/conf. You can check more about it at https://docs.bitnami.com/aws/infrastructure/lamp/administration/use-htaccess/.

If you want to enable .htaccess usage, you would need to set it to AllowOverride All in /opt/bitnami/apache2/conf/bitnami/bitnami.conf file:

<VirtualHost _default_:80>
  DocumentRoot "/opt/bitnami/apache2/htdocs"
  <Directory "/opt/bitnami/apache2/htdocs">
    Options Indexes FollowSymLinks
    AllowOverride All <---- HERE
    <IfVersion < 2.3 >
      Order allow,deny
      Allow from all
    </IfVersion>
    <IfVersion >= 2.3 >
      Require all granted
    </IfVersion>
  </Directory>

Restart Apache after applying your changes.

Regards

over 4 years ago · Santiago Trujillo Relatório

0

  • Open Terminal
  • type ls (you'll see a list of directories & files)
  • type cd apps/wordpress/conf
  • type ls
  • type nano htaccess.conf

htaccess file will open. edit it as per your requirements and press ctrl + x to exit be sure to press y to save the changes. reboot the lightsail instance. done.

over 4 years ago · Santiago Trujillo Relatório

0

if you've done configuring the SSL configuration then add the redirect option on your vhost file which you must have created for the website to view online.
Whatever modification you do to your server please make sure to create back up and always try to create new modification files. So you could use the redirect option on you app's virtual host file.

<VirtualHost *:80> 
    ServerName your_domain_name.com
    ServerAlias www.your_domain_name.com
    Redirect permanent / https://www.your_domain_name.com/
    DocumentRoot /opt/bitnami/apache2/htdocs 
    <Directory "/opt/bitnami/apache2/htdocs">
          Options -Indexes +FollowSymLinks -MultiViews 
      AllowOverride All 
      Require all granted
  </Directory>
</VirtualHost>

Hope this works for you.

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda