Ergebnis 1 bis 3 von 3

Thema: URL ohne .html Suffix und Mehrsprachigkeit: Backend nicht erreichbar

  1. #1
    Contao-Nutzer
    Registriert seit
    22.02.2010.
    Beiträge
    38

    Standard URL ohne .html Suffix und Mehrsprachigkeit: Backend nicht erreichbar

    Hallo zusammen,
    ich setzte momentan eine Installation mit mehreren Sprachen auf, "addLanguageToUrl" is ebenfalls aktiviert. Der Kunde wünscht sich, dass das .html Suffix entfernt wird. Ich habe die .htaccess dementsprechend bearbeitet und die Frontend Seite funktioniert wunderbar nach dem Schema website.com/en/contact.
    Leider kann ich nun das Backend nicht mehr aufrufen. Jedesmal wenn ich das Backend mit website.com/contao aufrufe, wird der Link zu website.com/en/contao aufgelöst und eine Fehlermeldung ausgegeben, dass die Seite nicht existiert.

    Ich wäre überaus dankbar falls mir jemand helfen könnte die .htaccess dementsprechend anzupassen:

    Code:
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      ##
      # Change the RewriteBase if your Contao installation is in a subdirectoy and
      # the rewrite rules are not working properly. Usage examples:
      #
      #   RewriteBase /contao-3.0.0
      #   RewriteBase /path/to/contao
      #
      # Depending on your server, you might have to remove the line entirely.
      ##
      RewriteBase /
    
      ##
      # Uncomment the following lines to add "www." to the domain:
      #
      #   RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
      #   RewriteRule (.*) http://www.example.com/$1 [R=301,L]
      #
      # Uncomment the following lines to remove "www." from the domain:
      #
      #   RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
      #   RewriteRule (.*) http://example.com/$1 [R=301,L]
      #
      # Make sure to replace "example.com" with your domain name.
      ##
    
      ##
      # If you cannot use mod_deflate, uncomment the following lines to load a
      # compressed .gz version of the aggregated Contao JavaScript and CSS files.
      ##
      #AddEncoding gzip .gz
      #<FilesMatch "\.js\.gz$">
      #  AddType "application/javascript" .gz
      #</FilesMatch>
      #<FilesMatch "\.css\.gz$">
      #  AddType "text/css" .gz
      #</FilesMatch>
      #RewriteCond %{HTTP:Accept-encoding} gzip
      #RewriteCond %{REQUEST_FILENAME} \.(js|css)$
      #RewriteCond %{REQUEST_FILENAME}.gz -f
      #RewriteRule ^(.*)$ $1.gz [QSA,L]
    
      ##
      # By default, Contao adds ".html" to the generated URLs to simulate static
      # HTML documents. If you change the URL suffix in the back end settings, make
      # sure to change it here accordingly!
      #
      #   RewriteRule .*\.html$ index.php [L]   # URL suffix .html
      #   RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
      #   RewriteRule .*\.json$ index.php [L]   # URL suffix .json
      #
      # If you do not want to use an URL suffix at all, you have to add a third
      # line to prevent URLs that point to folders from being rewritten (see #4031).
      #
      #   RewriteCond %{REQUEST_FILENAME} !-d
      #   RewriteRule .* index.php [L]
      #
      # If you are using mod_cache, it is recommended to use the RewriteRule below,
      # which adds the query string to the internal URL:
      #
      #   RewriteRule (.*\.html)$ index.php/$1 [L]
      #
      # Note that not all environments support mod_rewrite and mod_cache.
      ##
      RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|map|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|otf|tt[cf]|woff2?|svgz?|pdf|zip|gz)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .* index.php [L]
    
      ##
      # The following rules are required if you want to pass the language as first
      # URL parameter (added in Contao 2.11). The first rule rewrites the empty URL
      # to the front end controller, the second one adds a missing trailing slash.
      ##
      RewriteRule ^[a-z]{2}(\-[A-Z]{2})?/$ index.php [L]
      RewriteRule ^([a-z]{2}(\-[A-Z]{2})?)$ $1/ [R=301,L]
    
    </IfModule>

  2. #2
    Wandelndes Contao-Lexikon Avatar von tab
    Registriert seit
    22.10.2013.
    Beiträge
    10.081
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Das ist jetzt der klassische Fall von "Wer lesen kann ist klar im Vorteil" Steht doch drin im Kommentar in der .htaccess.

    Code:
      # If you do not want to use an URL suffix at all, you have to add a third
      # line to prevent URLs that point to folders from being rewritten (see #4031).
      #
      #   RewriteCond %{REQUEST_FILENAME} !-d
      #   RewriteRule .* index.php [L]
    gibt also insgesamt unterm Strich:
    Code:
      RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|map|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|otf|tt[cf]|woff2?|svgz?|pdf|zip|gz)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule .* index.php [L]

  3. #3
    Contao-Nutzer
    Registriert seit
    22.02.2010.
    Beiträge
    38

    Standard

    Ob du es glaubst oder nicht, das hatte ich auch so eingestellt und wurde wie gewünscht zum Backend login weitergeleitet. Ich geb die login Daten ein, nichts passiert. Keine Fehlermeldung, einfach nur eine Weiterleitung zurück zum Login.

    Jetzt habe ich gerade mal einen anderen Browser (Chrome) ausprobiert (ich benutze Safari) und damit klappts. hm!

    Besten dank jedenfalls, einen schönen Abend noch!

Aktive Benutzer

Aktive Benutzer

Aktive Benutzer in diesem Thema: 1 (Registrierte Benutzer: 0, Gäste: 1)

Lesezeichen

Lesezeichen

Berechtigungen

  • Neue Themen erstellen: Nein
  • Themen beantworten: Nein
  • Anhänge hochladen: Nein
  • Beiträge bearbeiten: Nein
  •