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

266
Views
.htaccess RewriteEngine causing Unexpected 403 Forbidden http response code in xampp

I am using xampp to test out some php code.

In the main project directory, I have the following .htaccess file:

RewriteEngine on

#Index
RewriteCond %{REQUEST_FILENAME} ^/$  
RewriteRule request_handler.php [L]

#php files
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f [OR]
RewriteCond %{REQUEST_FILENAME} ^.*(\.php)$
RewriteRule . request_handler.php [L]

#Blocked files. PHP blocked files should be specified in request_handler.php
<Files "setup.json">
    Order Allow,Deny
    Deny from all
</Files>
<Files "testimonials.json">
    Order Allow,Deny
    Deny from all
</Files>

#CACHE CONTROLL FOR STATIC RESOURSES
<FilesMatch "\.(jpg|jpeg|png|gif|swf)$">
    Header set Cache-Control "max-age=2592000, public"
</FilesMatch>

Anyhow, I am getting an unexpected 403 forbidden in all my requests. If I remove the first line of the .htaccess file though, I stop getting that unsuspected behavior.

Does anyone know what might be causing this error?

UPDATE I have created a new .htaccess file, that only contains one line: RewriteEngine On and I still get the error. (If I remove that line, I stop getting the error). The sole presence of that line causes the error.

over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Turns out, all I had to do was add the line Options FollowSymLinks before the RewriteEngine On directive.

Here's what Apache has to say:

To enable the rewrite engine in this context, you need to set "RewriteEngine On" and "Options FollowSymLinks" must be enabled. [...] This restriction is required for security reasons.

Apache documentation

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!