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

607
Visualizações
apache setup .htaccess rewriteRule with laravel

im setting up (laravelproj/public/.htaccess)

the example ones that I've worked on 2 different servers as follows:

<IfModule mod_rewrite.c>
    <IfModule mod_negotiation.c>
        Options -MultiViews -Indexes
    </IfModule>
    RewriteEngine On

    RewriteCond %{HTTPS} off
    RewriteRule ^(.*)$ https://takaful.hsn93.com/$1 [R,L]

    # Handle Authorization Header
    RewriteCond %{HTTP:Authorization} .
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]

    # Redirect Trailing Slashes If Not A Folder...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_URI} (.+)/$
    RewriteRule ^ %1 [L,R=301]

    # Handle Front Controller...
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^ index.php [L]

</IfModule>

now I'm trying it on cent OS apache (httpd) (if that matters) enter image description here and when i put in the link (http://example.com/) < apache returns the following:

i dont have any other problem except this link ^ with no parameters ^

Forbidden

You don't have permission to access / on this server.

so to make it work i'd to comment this line (condition where it checks if the requested isnt directory:

 #RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ index.php [L]

which make sense because / is of course a directory ..

but why did this .htaccess configuration worked on all other machines? what is different on this machine that makes this condition returning a forbidden from apache

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

0

i found the problem is that httpd.conf

doesnt index (index.php) files just (index.html)

so i modified it

<IfModule dir_module>
    DirectoryIndex index.html
    DirectoryIndex index.php
</IfModule>
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