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

134
Views
Ajax GET for error_log contents works locally but returns 403 on server

I have that tiny script :

<script>
$( document ).ready(function() {
    $('button').on('click', function(event, state) {
            var path = $(this).data("path");
            console.log(path);
            $.ajax({
              type:"GET",
              url: path,
              dataType: 'text',
              contentType: 'text',
              async: true,
              success: function (data) {
                  $("#file-content").text(data);
              }
          });
        });     
});
</script>

and HTML part is :

<button type="button" class="btn btn-primary" data-path="/error_log">error_log</button>
<button type="button" class="btn btn-primary" data-path="/log.txt">log.txt</button>
<div id="file-content" style="white-space: pre-line;"></div>

That code works perfectly on my Macbook, running apache locally. But once uploaded on my server, the loading of /log.txt works perfectly BUT loading error_log file returns 403 error. I checked permissions on those files and they are exactly the same permissions :

-rw-r--r--.  1 XXXXXXXXX XXXXXXXXX  1000 14 aoû 23:00 error_log
-rw-r--r--.  1 XXXXXXXXX XXXXXXXXX  6032 16 aoû 09:55 log.txt

I can't figure out the problem. Could you help me please ??

Best regards,

T.

over 4 years ago · Santiago Trujillo
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!