Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

606
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!