Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

php

.htaccess

403 FORBIDDEN

You don't have permission to access/folder_name/index.php on this server.

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

Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.

Here is .htaccess code:

<Files 403.shtml> 
order allow,
deny allow from all 
</Files> 

And I also tried another code:

<Directory "/path/to/source/file/directory/www"> 
Options Indexes FollowSymLinks 
AllowOverride all 
Require all granted 
</Directory> 

But I am confused on the line "path/to/source/file/directory/www".

like image 313
APARNNA MS Avatar asked Mar 17 '17 04:03

APARNNA MS


People also ask

Why htaccess not working on server?

In order to verify this, you must open the Apache configuration file (typically either called httpd. conf or apache. conf ) and check that the AllowOverride directive is set to AllowOverride All . If you needed to make changes to your Apache config, remember to save the file and restart Apache.

What should file permissions be for htaccess?

What permissions should the file have? 644 permissions are usually fine for an . htaccess file. When you create the file on the server, it should already have these permissions set, so there is most likely nothing to change.

What is a .htaccess file?

. htaccess files (or "distributed configuration files") provide a way to make configuration changes on a per-directory basis. A file, containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all subdirectories thereof.


2 Answers

Make sure that the .htaccess file is readable by apache:

chmod 644 access/folder_name/.htaccess 

And make sure the directory which contains .htaccess is readable and executable:

chmod 755 access/folder_name/
like image 94
Roshan Kumara Avatar answered Sep 19 '22 13:09

Roshan Kumara


If you are using cpanel, then go to the public HTML folder or else which subfolder creating the problem. right click the folder, you get the option, change permission. make alternative changes accordingly so you can make live your web page enter image description here

like image 31
Prince Paul Avatar answered Sep 20 '22 13:09

Prince Paul