[3.3] Weiterleitung auf eigenes Error Document (403) scheitert

Fragen rund um die Installation, Administration und Benutzung von phpBB.
Forumsregeln
Bitte im Thementitel den Präfix deiner phpBB-Version angeben
Benutzeravatar
LukeWCS
Supporter
Supporter
Beiträge: 3194
Registriert: 15.12.2014 10:19

Re: [3.3] Weiterleitung auf eigenes Error Document (403) scheitert

Beitrag von LukeWCS »

IMC hat geschrieben: 25.10.2025 00:11 Die Seite, auf die der Gesperrte weitergeleitet werden soll, muss für ihn zugänglich sein.
Verflixt, ich hab übersehen, dass der Aufruf der mit ErrorDocument verknüpften Datei selber in einen 403 läuft. :oops:
Möge das Backup mit dir sein. Immer.
Kein Support via PN! Siehe den Punkt "Private Nachrichten" im phpBB.de-Knigge.
Erweiterungen - Infos zur artgerechten Haltung / phpBB Ext Check - Analyse von Erweiterungen bezüglich Vorgaben und Kompatibilität
Pilz
Mitglied
Beiträge: 9
Registriert: 17.07.2015 12:52

Re: [3.3] Weiterleitung auf eigenes Error Document (403) scheitert

Beitrag von Pilz »

Wow
Erstmal vielen Dank für die vielen Antworten.
Ich habe angefangen die Hinweise abzuarbeiten und zuerst diversen Kram rausgeschmissen was nichts mit phpBB3 zu tun hat, damit es übersichtlicher wird.
Drin geblieben ist nur die Anweisung zur Fehlerseite und die Sperre meiner IP Adresse:

Code: Alles auswählen

AddHandler x-httpd-opcache-php8.0 .php

# Fehler Forbidden:
	ErrorDocument 403 /403.html

	Order Allow,Deny
	Deny from xx.xxx.xxx.xxx
	Allow from all

<IfModule mod_rewrite.c>
RewriteEngine on

#
# Uncomment the statement below if URL rewriting doesn't
# work properly. If you installed phpBB in a subdirectory
# of your site, properly set the argument for the statement.
# e.g.: if your domain is test.com and you installed phpBB
# in http://www.test.com/phpBB/index.php you have to set
# the statement RewriteBase /phpBB/
#
#RewriteBase /

#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]

#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>

# With Apache 2.4 the "Order, Deny" syntax has been deprecated and moved from
# module mod_authz_host to a new module called mod_access_compat (which may be
# disabled) and a new "Require" syntax has been introduced to mod_authz_host.
# We could just conditionally provide both versions, but unfortunately Apache
# does not explicitly tell us its version if the module mod_version is not
# available. In this case, we check for the availability of module
# mod_authz_core (which should be on 2.4 or higher only) as a best guess.
<IfModule mod_version.c>
	<IfVersion < 2.4>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfVersion>
	<IfVersion >= 2.4>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfVersion>
</IfModule>
<IfModule !mod_version.c>
	<IfModule !mod_authz_core.c>
		<Files "config.php">
			Order Allow,Deny
			Deny from All
		</Files>
		<Files "common.php">
			Order Allow,Deny
			Deny from All
		</Files>
	</IfModule>
	<IfModule mod_authz_core.c>
		<Files "config.php">
			Require all denied
		</Files>
		<Files "common.php">
			Require all denied
		</Files>
	</IfModule>
</IfModule>
DirectoryIndex app.php/portal index.php index.html index.htm

Das Ergebnis ist unterschiedlich:

Rufe ich https://domain.de/ auf, wird meine Fehlerseite angezeigt.
Rufe ich https://domain.de/app.php/portal oder z.B. https://domain.de/viewtopic.php?f=27&t=26345 auf, wird die Seite vom Server ausgegeben:
Forbidden
You don't have permission to access this resource.
Additionally, a 403 Forbidden error was encountered while trying to use an ErrorDocument to handle the request.


Setze ich anstelle des Pfades eine URL ein, bekomme ich diese Fehlermeldung, egal was ich aufrufe:
Diese Seite funktioniert nicht
domain.de hat dich zu oft weitergeleitet.


Und wenn ich meine eigene Fehlermeldung in der htaccess mit html hart kodiere, dann funktioniert das alles einwandfrei.
Das ist im Prinzip für mich auch ausreichend, da das Ergebnis das Gleiche ist.

Wenn aber Interesse daran besteht dem Problem weiter auf den Grund zu gehen, dann bitte...

Grüsse
Stefan
Antworten

Zurück zu „Support-Forum“