Problems with .htaccess in Lampstack

1

I have the following problem.

I have a website that uses htaccess. I work locally on the website and it works normally, all redirects work perfectly. When I went to upload my application to the ratification server (an Amazon ec2 with Bitnami Lampstack) my redirects stopped working. It recognizes htaccess, it even works on some links, but it does not work the same as my local environment. Anyone have any idea what it might be?

Follow the htaccess code

<IfModule mod_rewrite.c>
   RewriteEngine On

   #PAGINAS
   RewriteRule ^Paginas/(.*)/(.*)-([0-9]+)?$ Paginas.php?Codigo=$3 [L]

   #PROGRAMAS
   RewriteRule ^Programas/(.*)/(.*)-([0-9]+)?$ Programas.php?Codigo=$3 [L]

   #VIDEOS
   RewriteRule ^Videos/?$ Videos.php [L]

   #VIDEOS
   RewriteRule ^Videos/(.*)-([0-9]+)?$ VideosDetalhes.php?Codigo=$2 [L]

   #GALERIAS
   RewriteRule ^Galerias/?$ Galerias.php [L]
   RewriteRule ^Galerias/Categorias/(.*)-([0-9]+)?$ GaleriasCategorias.php?Codigo=$2 [L]
   RewriteRule ^Galerias/(.*)-([0-9]+)?$ GaleriasDetalhes.php?Codigo=$2 [L]

   #UNIDADES
   RewriteRule ^Unidades/?$ Unidades.php [L]
   RewriteRule ^Unidades/(.*)/(.*)-([0-9]+)?$ UnidadesDetalhes.php?Codigo=$3 [L]
   RewriteRule ^Unidades/(.*)/(.*)-([0-9]+)/retorno/?$ UnidadesDetalhesRetorno.php?Codigo=$3 [L]

   #NOTICIAS
   RewriteRule ^Noticias/?$ Noticias.php [L]
   RewriteRule ^Noticias/(.*)-([0-9]+)?$ NoticiasDetalhes.php?Codigo=$2 [L]

   #CONTATO
   RewriteRule ^Contato/?$ FaleConosco.php [L]

   #TRABALHE CONOSCO
   RewriteRule ^Trabalhe-Conosco/?$ TrabalheConosco.php [L]

   #DEPOIMENTOS
   RewriteRule ^Depoimentos/?$ Depoimentos.php [L]
   RewriteRule ^Depoimentos/(.*)-([0-9]+)?$ DepoimentosDetalhes.php?Codigo=$2 [L]

   #INTERCAMBIO BUSCA
   RewriteRule ^Intercambio/Busca/?$ DestinosBusca.php [L]

   #BUSCA
   RewriteRule ^Busca/?$ Busca.php [L]

   #INTERCAMBIO EM GRUPO
   RewriteRule ^Intercambio-em-Grupo/?$ Formulario1.php [L]

   #FILES AND DIRECTORIES
   RewriteCond %{REQUEST_FILENAME} !-f
   RewriteCond %{REQUEST_FILENAME} !-d
   RewriteRule .* LinkSlug.php?Link=$0 [L]

</IfModule>
    
asked by anonymous 22.10.2014 / 19:30

1 answer

2

Well, as it is with a specific server it is difficult to pinpoint the problem, in a quick web search I found a similar case and the solution was as follows

Create a file named rewrite.conf in /etc/apache2/mods-enabled in this file put the following line: LoadModule rewrite_module /usr/lib/apache2/modules/mod_rewrite.so

After this restart apache: sudo service apache2 restart

In addition you can add the following in your .htaccess RewriteBase /

Hope it works for you

    
22.10.2014 / 19:45