Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

611
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda