Verwendung: Umleitung alter html Seiten auf ohne Suffix

Jörg's Avatar

Jörg

23 Jul, 2026 06:52 AM

Produkt: Tao Contao
Contao-Version: 5.3

Hi zusammen,
wir stellen derzeit ältere Versionen auf 5.x um. In den Suchmaschinen ist die Verlinkung noch mit *.html hinterlegt. Diese führen dann natürlich zu einer Fehlerseite. Wie kann man es umstellen, dass der alte link auf ohne Suffix weiterleitet? Google Search-Index ist zwar informiert, dauert aber ewig, bis es funktioniert. Danke!

  1. Support Staff 1 Posted by RockSolid Theme... on 23 Jul, 2026 03:27 PM

    RockSolid Themes's Avatar

    Vielen Dank für Ihre Frage.

    Wenn Sie einen Webserver mit .htaccess-Unterstützung haben, lässt sich das mit einer allgemeinen Regel in der .htaccess-Datei umsetzen:

    RewriteRule ^(.*)\.html$ /$1 [R=301,L]
    

    Dies betrifft dann sämtliche URLs dieser Domain. Wenn es also teilweise noch URLs mit .html-Suffix gibt müsste diese Regel weiter eingeschränkt werden damit sie nur auf die gewünschten URLs angewendet wird.

    Eine Alternative wäre die für die gesamte Liste der alten URLs einzelne Redirects einzurichten.

  2. 2 Posted by Jörg on 23 Jul, 2026 04:51 PM

    Jörg's Avatar

    Hi Danke für die schnelle Antwort.
    Wenn ich die Zeile wie folgt in die .htaccess einfüge...

    <IfModule mod_rewrite.c>
        RewriteEngine On

        RewriteRule ^(.*)\.html$ /$1 [L,R=301]

    </IfModule>

    Erhalte ich im Frontend folgende Fehlermeldung:

    Internal Server Error

    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Please contact the server administrator at root@localhost to inform them of the time this error occurred, and the actions you performed just before this error.

    More information about this error may be available in the server error log.

    Wo liegt der Haken?

  3. Support Staff 3 Posted by RockSolid Theme... on 24 Jul, 2026 12:16 PM

    RockSolid Themes's Avatar

    Wo liegt der Haken?

    Das ist aus der Ferne schwer zu sagen. Eventuell liegt ein Problem mit dem Webserver vor. Als Alternative können Sie versuchen die Umleitung mit einem anderen Modul umzusetzen:

    <IfModule mod_alias.c>
        RedirectMatch 301 ^/(.*)\.html$ /$1
    </IfModule>
    

    Falls auch hiermit ein Server-Fehler auftritt, wenden Sie sich am besten direkt an Ihren Hosting-Provider.

  4. 4 Posted by Jörg on 24 Jul, 2026 12:42 PM

    Jörg's Avatar

    Leider das gleiche Ergebnis. Ich erkundige mich beim Provider.

  5. Support Staff 5 Posted by RockSolid Theme... on 24 Jul, 2026 12:49 PM

    RockSolid Themes's Avatar

    Eventuell lässt sich die Umleitung auch mit der Contao-Erweiterung terminal42/contao-url-rewrite realisieren.

Reply to this discussion

Internal reply

Formatting help / Preview (switch to plain text) No formatting (switch to Markdown)

Attaching KB article:

»

Attached Files

You can attach files up to 10MB

If you don't have an account yet, we need to confirm you're human and not a machine trying to post spam.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac