Forum Moderators: phranque
Forbidden
You don't have permission to access /index.php on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
RewriteCond %{DOCUMENT_ROOT}/wp-content/cache/all/$1/index.html -f [or]
RewriteCond /home/user/example.com/wp-content/cache/all/$1/index.html -f
RewriteRule ^(.*) "/wp-content/cache/all/$1/index.html" [L] # Define directory index
DirectoryIndex index.html index.php # Disable directory browsing
Options -Indexes
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress RewriteRule ^forbidden\.html - [L]
(using, ahem, the actual name and URLpath of your 403 document). This rule goes before all other RewriteRules.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.This is the part that should never happen. The server is trying to bring up the ErrorDocument, and is being denied. Does your host have a default ErrorDocument name? They're often built-in, even if an individual site may choose not to use it; you'll find the name somewhere in your host's documentation. (That's why I used "forbidden.html" above.) Put in the suggested RewriteRule, using the host's default name, and see if there is any change in the response you get.
[Wed Oct 17 12:35:54 2018] [error] [client IP] Request exceeded the limit of 10 internal redirects due to probable configuration error.
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [OR]
RewriteCond %{HTTP_REFERER} !^http(s)?://(.*)?\.example\.com
RewriteRule \.(bmp|gif|jpe?g|png)$ - [F] RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$ [OR]
RewriteCond %{HTTP_REFERER} !^http(s)?://(.*)?\.googlample\.com [OR]
RewriteCond %{HTTP_REFERER} !^http(s)?://(.*)?\.example\.com
RewriteRule \.(bmp|gif|jpe?g|png)$ - [F] !^http(s)?://(.*)?\.example\.comOverkill. All you need to say is
\bexample\.com
or at most ^https://example\.com
If you are getting fake referers--very unlikely in this situation--the last thing you want to do is permit incorrect forms, like http when your site is https, or with-www when your site is without. RewriteCond %{HTTP_REFERER} !^http://example\.com/
RewriteCond %{HTTP_REFERER} .
<snip>
RewriteCond %{HTTP_REFERER} !\b(google|translate|bing|duckduckgo|ecosia|search\.yahoo|yandex)\b
ymmv, obviously, notably in the case of “translate”. The <snip> here refers to I was under the impression Apache had some sort of on board default 403 responseOn shared hosting there will often be a meta-default where the config file specifies an ErrorDocument, and a corresponding <Files> in config makes sure everyone can see it. This means that error logs of sites without the specified custom 403 page will show two lines for every 403: one for “request denied” and a second for “file not found”. But no infinite loops, and the request receives the intended 403.
On shared hosting there will often be a meta-default where the config file specifies an ErrorDocument, and a corresponding <Files> in config makes sure everyone can see it. This means that error logs of sites without the specified custom 403 page will show two lines for every 403: one for “request denied” and a second for “file not found”. But no infinite loops, and the request receives the intended 403.
<files offlimits.txt>
order allow,deny
deny from all
</files> Forbidden
You don't have permission to access /offlimits.txt on this server.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.
[Thu Oct 18 13:10:20 2018] [error] [client IP] client denied by server configuration: /home/user/example.com/offlimits.txt
[Thu Oct 18 13:10:20 2018] [error] [client IP] Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Thu Oct 18 13:12:51 2018] [error] [client IP] client denied by server configuration: /home/user/example.com/
[Thu Oct 18 13:12:51 2018] [error] [client IP] client denied by server configuration: /home/user/example.com/forbidden.html
# BEGIN WordPress
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress # BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress So what is generating this message? My server? My browser?The server. In fact it's pretty inept of the server to be putting the part about the ErrorDocument out in the open, but that's what servers do. The internal redirects, on the other hand, do point to some kind of misconfiguration. If it were your own server you certainly wouldn't want it handling eleven internal requests (1 + 10) on every single 403, since that means it's doing ten times as much work as necessary, on just those requests where you don't want it doing any work at all.