Error 403 in Loading Resources Like CSS and Js in My Index.Php

ERROR 403 in loading resources like CSS and JS in my index.php

You need to change permissions on the folder bootstrap/css.
Your super user may be able to access it but it doesn't mean apache or nginx have access to it, that's why you still need to change the permissions.

Tip: I usually make the apache/nginx's user group owner of that kind of folders and give 775 permission to it.

ERROR 403 in loading resources like CSS in my index.php

The problem comes from SELinux

SELinux is preventing httpd from read access on the file

So, my solution: running command

setsebool -P httpd_read_user_content 1

403 error for js files in vendor directory on Heroku

Turns out that I had to specify the document root as a second parameter in the Procfile: web: vendor/bin/heroku-php-apache2 webroot/

How to use apache 403 error as routing technique with htacess

Your .htaccess is wrong, you are using ErrorDocument 403 to load a file index.php, (ErrorDocument is used normally for custom error pages not for loading a normal resource) you wish have a Forbidden when try to load login/ because this folder doesn't have a index.php file but I suspect that you have in your VirtualHost the option Indexes, this directive loads the folder contents but doesn't serve a 403 error.

My VirtualHost for testing purpose is:

<VirtualHost localhost-test:80>
ServerName localhost-test
ServerAlias localhost-test
ErrorLog "logs/localhost-test-error.log"
TransferLog "logs/localhost-test-access.log"
DocumentRoot "D:/Web/test"
<Directory />
Require all granted
Options FollowSymLinks Includes ExecCGI
AllowOverride All
</Directory>
</VirtualHost>

If you remove Indexes from your VirtualHost you can see the Forbidden error custom page. You should have:

ErrorDocument 404 /public/error_pages/404.php
ErrorDocument 500 /public/error_pages/500.php
ErrorDocument 403 /public/error_pages/403.php

Now if you try to load the folder /login/ without an index.php file inside, you should have a Forbidden 403 with your custom page error but using JQuery in meanwhile you can load the login.php file instead.

I hope this helps.

yii2 framework - error 403 when using images

  1. Check that img directory is in public web direcory (where the index.php placed). Your web direcory should look like this:

    assets

    css

    img

    index.php

    ...

  2. Check access rights to img directory and logo2.png file. They must be readable for the web server. For linux you can run this command in yii root directory chmod -R a+r web/img

Hostinger web share shoting giving back 403 forbidden error

  1. Copy the .htacces file from the public folder and paste it outside of the public folder

  2. Rename server.php to index.php

Loading website server side returns 403 error

Some people don't like servers accessing their stuff. They provide a service intended for human consumers, and not bots. Therefore they may include code that checks whether you are in fact a human using a web browser, which your naïve PHP script is failing to provide. Therefore, the third-party is returning a 403 Forbidden error, indicating that it is forbidden for your program to access it.

There are ways around this, of course, depending on how it's implemented. The most obvious thing to do is send a User-Agent header pretending to be a browser. But servers may do more clever checks than this, and it's questionably moral.



Related Topics



Leave a reply



Submit