Server unable to read htaccess file, denying access to be safe

前端 未结 14 2831
情深已故
情深已故 2020-12-12 20:15

I have created a simple app using AngularJS. When I tried to host that project in my website http://demo.gaurabdahal.com/recipefinder it shows the following error:

相关标签:
14条回答
  • 2020-12-12 20:48

    In my case apache was somehow configured wrong(?) so I had to set permissions to all parent dirs too. Just setting permission to .htaccess (and it's parent dir) didn't work.

    0 讨论(0)
  • 2020-12-12 20:48

    As for Apache running on Ubuntu, the solution was to check error log, which showed that the error was related with folder and file permission.

    First, check Apache error log

    nano /var/log/apache2/error.log
    

    Then set folder permission to be executable

    sudo chmod 755 /var/www/html/
    

    Also set file permission to be readable

    sudo chmod 644 /var/www/html/.htaccess
    
    0 讨论(0)
  • 2020-12-12 20:56

    Every public folder makes the permission to 755. Problem solved.

    0 讨论(0)
  • 2020-12-12 20:57

    I had the same problem on a rackspeed server after changing the php version in the cpanel. Turned out it also changed the permissions of the folder... I set the permission of the folder to 755 with

    chmod 755 folder_name
    
    0 讨论(0)
  • 2020-12-12 20:58

    In linux,

    find project_directory_name_here -type d -exec chmod 755 {} \;
    find project_directory_name_here -type f -exec chmod 644 {} \;
    

    It will replace all files and folder permission of project_directory_name_here and its inside stuff.

    0 讨论(0)
  • 2020-12-12 21:01

    Set group of your public directory to nobody.

    0 讨论(0)
提交回复
热议问题