Contao-Camp 2024
Ergebnis 1 bis 19 von 19

Thema: Mal wieder Umschreiben von URLs

  1. #1
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard Mal wieder Umschreiben von URLs

    Hallo zusammen,

    ich habe bei 1und1 Contao installiert und möchte die URLs umschreiben. Häkchen unter Einstellungen ist gesetzt. .htaccess.default ist umbenannt nach .htaccess. Die erste Seite "/en" wird gefunden, die Restlichen Seiten bleiben weiß.

    Wenn in der .htaccess noch

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php [L]

    aktiviere. Nun funktioniert das Laden der Seiten, CSS und Grafiken aus dem files-Ordner werden jedoch nicht mehr geladen. An das Backend komme ich auch nicht mehr ran.

    Habt ihr mir einen Tipp, was das sein kann?

    Vielen Dank im Voraus.

    Herzliche Grüsse,
    Christoph

  2. #2
    AG Pressearbeit
    Community-Moderator
    Buchautor 'Contao für Webdesigner'
    Avatar von planepix
    Registriert seit
    05.06.2009.
    Ort
    Stuttgart
    Beiträge
    6.464
    Partner-ID
    107
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hallo Christoph,

    folgende Checkliste würde ich durchgehen:
    1. Liegt die Contao-Installation im Root der Domain? Oder in einem Unterverzeichnis?
    -> wenn im Root: Keine weiteren Anpassungen in der .htaccess bei RewriteBase und in der pathconfig.php im Verzeichnis system/config/.
    -> wenn in einem Unterverzeichnis und nicht im Kundencenter Weiterleitung auf den Unterordner: -> Anpassung in der .htaccess bei RewriteBase ( statt / dann /namedesverzeichnis ) und in der pathconfig (statt '' dann '/namedesverzeichnis' ).

    2. Den Contao-Check in das Verzeichnis, in dem Contao liegt, hochladen und aufrufen. Neben dem Aufruf von www.domain.tld/check auch auf die Schaltfläche „Eine bestehende Installation überprüfen” klicken. Wenn dort Fehler angezeigt werden, bitte posten.
    ---------------------------------
    Beste Grüße planepix
    Contao für Webdesigner (Website), Twitter: @contaowebdesign
    weitzeldesign
    Contao-Sprechstunde
    Contao Schulungen: https://www.weitzeldesign.com/cms-co...chulungen.html
    Contao Jahrbuch: www.contao-jahrbuch.de
    Contao Agenturtag: www.contao-agenturtag.de
    Contao Stammtisch Stuttgart: www.contao-stammtisch-stuttgart.de
    Contao 4 Erfahrungen als Gitbook: https://app.gitbook.com/@planepix/s/...-mit-contao-4/
    Contao 4 & Manager Hosterhinweise: https://github.com/contao/contao-manager/wiki

    Schon wieder ein Update?
    Glücklich sind die, die den Wert erkennen – und wertschätzen.
    „Muss man machen wie beim Zahnarzt. Der bestraft einen auch mit hohen Rechnungen wenn man die Pflege vernachlässigt.”

  3. #3
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Hallo planepix,

    danke Dir.

    Zitat Zitat von planepix Beitrag anzeigen
    1. Liegt die Contao-Installation im Root der Domain? Oder in einem Unterverzeichnis?
    Sie liegt im Root der Domain.

    Zitat Zitat von planepix Beitrag anzeigen
    2. Den Contao-Check in das Verzeichnis, in dem Contao liegt, hochladen und aufrufen. Neben dem Aufruf von www.domain.tld/check auch auf die Schaltfläche „Eine bestehende Installation überprüfen” klicken. Wenn dort Fehler angezeigt werden, bitte posten.
    Ausgabe vom Contao-Check:

    Code:
    Version
    
    Found a Contao 3.5.27 installation.
    Corrupt files
    
        contao/install.php
    
    Your installation is not up to date.
    In der install.php ist ein exit; eingefügt. Ansonsten ist nichts auffällig. Im Backend lese ich "Ihre Contao-Version 3.5.27 ist aktuell"

    -Christoph

  4. #4
    AG Pressearbeit
    Community-Moderator
    Buchautor 'Contao für Webdesigner'
    Avatar von planepix
    Registriert seit
    05.06.2009.
    Ort
    Stuttgart
    Beiträge
    6.464
    Partner-ID
    107
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hallo Christoph,

    danke für die Infos.

    Die install.php könntest du ersetzen; wenn du da eine Zeile ergänzt hast, ist es normal, das der Check das bemängelt.

    Folgende Ansätze habe ich noch:
    - aktiviere einmal in den Einstellungen die Fehlermeldungen. Erhältst du dann im Frontend beim Aufruf einer Unterseite eine Fehlermeldung?
    - steht etwas in den Errorlogs von Contao? In denen bei 1und1?
    - da du schreibst „ /en wird aufgerufen”: Ist es eine mehrsprachige Website? Sind die Sprachenfallbacks korrekt gesetzt?
    ---------------------------------
    Beste Grüße planepix
    Contao für Webdesigner (Website), Twitter: @contaowebdesign
    weitzeldesign
    Contao-Sprechstunde
    Contao Schulungen: https://www.weitzeldesign.com/cms-co...chulungen.html
    Contao Jahrbuch: www.contao-jahrbuch.de
    Contao Agenturtag: www.contao-agenturtag.de
    Contao Stammtisch Stuttgart: www.contao-stammtisch-stuttgart.de
    Contao 4 Erfahrungen als Gitbook: https://app.gitbook.com/@planepix/s/...-mit-contao-4/
    Contao 4 & Manager Hosterhinweise: https://github.com/contao/contao-manager/wiki

    Schon wieder ein Update?
    Glücklich sind die, die den Wert erkennen – und wertschätzen.
    „Muss man machen wie beim Zahnarzt. Der bestraft einen auch mit hohen Rechnungen wenn man die Pflege vernachlässigt.”

  5. #5
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Zitat Zitat von planepix Beitrag anzeigen
    Hallo Christoph,
    - aktiviere einmal in den Einstellungen die Fehlermeldungen. Erhältst du dann im Frontend beim Aufruf einer Unterseite eine Fehlermeldung?
    - steht etwas in den Errorlogs von Contao? In denen bei 1und1?
    Fehlermeldungen waren schon an. Habe das Log noch mal geleert. Weder im FE noch im BE eine Meldung. Habe noch mal gegoogelt und entdeckt, daß
    "AddHandler x-mapp-php6 .php3 .php4 .php .phtml" in der .htaccess hinzu müssen. Funktionierte aber nicht und ist wieder auskommentiert.

    Doch nun bekomme ich statt einer leeren Seite die 1und1-404-Seite. Es riecht also nach etwas bei 1und1. Rufe morgen dort mal an.

    Zitat Zitat von planepix Beitrag anzeigen
    Hallo Christoph,
    - da du schreibst „ /en wird aufgerufen”: Ist es eine mehrsprachige Website? Sind die Sprachenfallbacks korrekt gesetzt?
    Ja, soll es werden. Aktuell ist nur die englische Version da mit en als Sprachkürzel. Die Deutsche ist begonnen, jedoch der gesamte Baum deaktiviert.

  6. #6
    AG Pressearbeit
    Community-Moderator
    Buchautor 'Contao für Webdesigner'
    Avatar von planepix
    Registriert seit
    05.06.2009.
    Ort
    Stuttgart
    Beiträge
    6.464
    Partner-ID
    107
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Den AddHandler brauchst du mittlerweile nicht mehr; das kannst du im Kundencenter direkt je Domain einstellen.
    Wenn es eine 3.5 Version ist, kannst du PHP 5.6 oder 7 einstellen; einige Erweiterungen laufen noch nicht mit PHP 7; dann einfach mal diese Erweiterungen deaktivieren und einzeln aktivieren.

    Teste doch einmal, ob du bei deaktivierter URL-Umschreibung die Unterseiten aufrufen kannst.
    ---------------------------------
    Beste Grüße planepix
    Contao für Webdesigner (Website), Twitter: @contaowebdesign
    weitzeldesign
    Contao-Sprechstunde
    Contao Schulungen: https://www.weitzeldesign.com/cms-co...chulungen.html
    Contao Jahrbuch: www.contao-jahrbuch.de
    Contao Agenturtag: www.contao-agenturtag.de
    Contao Stammtisch Stuttgart: www.contao-stammtisch-stuttgart.de
    Contao 4 Erfahrungen als Gitbook: https://app.gitbook.com/@planepix/s/...-mit-contao-4/
    Contao 4 & Manager Hosterhinweise: https://github.com/contao/contao-manager/wiki

    Schon wieder ein Update?
    Glücklich sind die, die den Wert erkennen – und wertschätzen.
    „Muss man machen wie beim Zahnarzt. Der bestraft einen auch mit hohen Rechnungen wenn man die Pflege vernachlässigt.”

  7. #7
    AG Pressearbeit
    Community-Moderator
    Buchautor 'Contao für Webdesigner'
    Avatar von planepix
    Registriert seit
    05.06.2009.
    Ort
    Stuttgart
    Beiträge
    6.464
    Partner-ID
    107
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Zitat Zitat von cfauck Beitrag anzeigen
    Ja, soll es werden. Aktuell ist nur die englische Version da mit en als Sprachkürzel. Die Deutsche ist begonnen, jedoch der gesamte Baum deaktiviert.
    Und im Moment ist dann Sprache en eingestellt und Sprachen-Fallback ist aktiviert?
    ---------------------------------
    Beste Grüße planepix
    Contao für Webdesigner (Website), Twitter: @contaowebdesign
    weitzeldesign
    Contao-Sprechstunde
    Contao Schulungen: https://www.weitzeldesign.com/cms-co...chulungen.html
    Contao Jahrbuch: www.contao-jahrbuch.de
    Contao Agenturtag: www.contao-agenturtag.de
    Contao Stammtisch Stuttgart: www.contao-stammtisch-stuttgart.de
    Contao 4 Erfahrungen als Gitbook: https://app.gitbook.com/@planepix/s/...-mit-contao-4/
    Contao 4 & Manager Hosterhinweise: https://github.com/contao/contao-manager/wiki

    Schon wieder ein Update?
    Glücklich sind die, die den Wert erkennen – und wertschätzen.
    „Muss man machen wie beim Zahnarzt. Der bestraft einen auch mit hohen Rechnungen wenn man die Pflege vernachlässigt.”

  8. #8
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.879
    Partner-ID
    10107

    Standard

    Poste deine gesamte .htaccess. Vermutlich hast du die oben erwähnte RewriteCond und RewriteRule falsch gesetzt.

  9. #9
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Zitat Zitat von planepix Beitrag anzeigen
    Den AddHandler brauchst du mittlerweile nicht mehr; das kannst du im Kundencenter direkt je Domain einstellen.
    Wenn es eine 3.5 Version ist, kannst du PHP 5.6 oder 7 einstellen; einige Erweiterungen laufen noch nicht mit PHP 7; dann einfach mal diese Erweiterungen deaktivieren und einzeln aktivieren.
    Getestet: PHP 5.4, 5.6, 7.0 -> kein Erfolg. Erweiterungen habe ich nur

    • dlh_geocode
    • dlh_googlemaps
    • MultiColumnWizard
    • selectModule


    In einem weiteren Contao-Projekt bei 1und1 funzen die.

    Zitat Zitat von planepix Beitrag anzeigen
    Teste doch einmal, ob du bei deaktivierter URL-Umschreibung die Unterseiten aufrufen kannst.
    Ja, das geht. Da funktioniert alles.

    Zitat Zitat von planepix Beitrag anzeigen
    Und im Moment ist dann Sprache en eingestellt und Sprachen-Fallback ist aktiviert?
    Korrekt. Gibt ja auch viel Geschrei, wenn der Sprachen-Fallback fehlt.

    Habe auch den DE-Zweig mal scharf geschaltet - gleiches Ergebnis.

    Werde Montag noch ein PHP-Errorlog probieren. Muss man bei 1und1 selbst über eine php.ini einrichten.

    Fast vergessen: habe ein Ticket bei 1und1 ausgelöst - mit entsprechenden Gesängen "Contao unterstützen wir nicht...". Aber die 1und1-404-Fehlerseite von gestern abend - sie kam mehrmals - riecht schon etwas muffelig. Wo kommt die her? Im Webspace liegt sie nicht.

    Hier die .htaccess - ohne Änderungen von der .htaccess.default übernommen. Nicht funktionierende Änderungen nehme ich immer gleich wieder raus.

    Code:
    ##
    # Contao Open Source CMS
    #
    # Copyright (c) 2005-2016 Leo Feyer
    #
    # @license LGPL-3.0+
    ##
    
    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
      </IfModule>
      <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
    </FilesMatch>
    
    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
        Header set Access-Control-Allow-Origin "*"
      </FilesMatch>
    </IfModule>
    
    ##
    # Disable ETags
    # @see http://developer.yahoo.com/performance/rules.html#etags
    ##
    FileETag None
    <IfModule mod_headers.c>
      Header unset ETag
    </IfModule>
    
    ##
    # Set the proper MIME types
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_mime.c>
      AddType application/javascript              js jsonp
      AddType application/json                    json
      AddType audio/ogg                           oga ogg
      AddType audio/mp4                           m4a f4a f4b
      AddType video/ogg                           ogv
      AddType video/mp4                           mp4 m4v f4v f4p
      AddType video/webm                          webm
      AddType video/x-flv                         flv
      AddType image/svg+xml                       svg svgz
      AddEncoding gzip                            svgz
      AddType application/vnd.ms-fontobject       eot
      AddType application/x-font-ttf              ttf ttc
      AddType font/opentype                       otf
      AddType application/x-font-woff             woff woff2
      AddType image/x-icon                        ico
      AddType image/webp                          webp
      AddType text/cache-manifest                 appcache manifest
      AddType text/x-component                    htc
      AddType application/xml                     rss atom xml rdf
      AddType application/x-web-app-manifest+json webapp
      AddType text/x-vcard                        vcf
      AddType application/x-shockwave-flash       swf
    </IfModule>
    
    ##
    # Gzip compression
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_deflate.c>
      <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
        AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
        AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
      </IfModule>
    </IfModule>
    
    ##
    # Expires headers (for better cache control)
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_expires.c>
      ExpiresActive on
    
      ##
      # Productional website
      ##
      ExpiresByType text/cache-manifest           "access plus 0 seconds"
      ExpiresByType text/html                     "access plus 0 seconds"
      ExpiresByType text/xml                      "access plus 0 seconds"
      ExpiresByType application/xml               "access plus 0 seconds"
      ExpiresByType application/json              "access plus 0 seconds"
      ExpiresByType application/rss+xml           "access plus 1 hour"
      ExpiresByType application/atom+xml          "access plus 1 hour"
      ExpiresByType image/gif                     "access plus 1 month"
      ExpiresByType image/png                     "access plus 1 month"
      ExpiresByType image/jpeg                    "access plus 1 month"
      ExpiresByType image/x-icon                  "access plus 1 month"
      ExpiresByType video/ogg                     "access plus 1 month"
      ExpiresByType audio/ogg                     "access plus 1 month"
      ExpiresByType video/mp4                     "access plus 1 month"
      ExpiresByType video/webm                    "access plus 1 month"
      ExpiresByType text/x-component              "access plus 1 month"
      ExpiresByType application/x-font-ttf        "access plus 1 month"
      ExpiresByType font/opentype                 "access plus 1 month"
      ExpiresByType application/x-font-woff       "access plus 1 month"
      ExpiresByType image/svg+xml                 "access plus 1 month"
      ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
      ExpiresByType text/css                      "access plus 1 year"
      ExpiresByType application/javascript        "access plus 1 year"
    
      ##
      # Disable caching during development
      # @see https://github.com/contao/core/issues/4364
      ##
      #ExpiresByType text/cache-manifest           "access"
      #ExpiresByType text/html                     "access"
      #ExpiresByType text/xml                      "access"
      #ExpiresByType application/xml               "access"
      #ExpiresByType application/json              "access"
      #ExpiresByType application/rss+xml           "access"
      #ExpiresByType application/atom+xml          "access"
      #ExpiresByType image/gif                     "access"
      #ExpiresByType image/png                     "access"
      #ExpiresByType image/jpeg                    "access"
      #ExpiresByType image/x-icon                  "access"
      #ExpiresByType video/ogg                     "access"
      #ExpiresByType audio/ogg                     "access"
      #ExpiresByType video/mp4                     "access"
      #ExpiresByType video/webm                    "access"
      #ExpiresByType text/x-component              "access"
      #ExpiresByType application/x-font-ttf        "access"
      #ExpiresByType font/opentype                 "access"
      #ExpiresByType application/x-font-woff       "access"
      #ExpiresByType image/svg+xml                 "access"
      #ExpiresByType application/vnd.ms-fontobject "access"
      #ExpiresByType text/css                      "access"
      #ExpiresByType application/javascript        "access"
    
    </IfModule>
    
    ##
    # Header adjustments
    ##
    <IfModule mod_headers.c>
    
      ##
      # Disable caching during development
      # @see https://github.com/contao/core/issues/4364
      ##
      #Header unset Cache-Control
      #Header append Cache-Control must-revalidate
    
      ##
      # Do not cache the cron.txt file
      # @see https://github.com/contao/core/issues/5105
      ##
      <FilesMatch "cron\.txt$">
        Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
      </FilesMatch>
    
      ##
      # Add a Vary Accept-Encoding header for the compressed resources. If you
      # modify the file types above, make sure to change them here accordingly.
      # @see http://developer.yahoo.com/performance/rules.html#gzip
      #
      # Note: If you are using a case-sensitive file system like HFS+ or ext4, you
      # have to change the <FilesMatch> directive as follows:
      #
      # <FilesMatch "\.(?i:js|css|xml|gz|svgz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      <FilesMatch "\.(js|css|xml|gz|svgz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    
      ##
      # Do not cache source map files
      # @see https://github.com/contao/core/issues/8532
      ##
      <FilesMatch "\.map$">
        Header set Expires "0"
        Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
      </FilesMatch>
    
    </IfModule>
    
    ##
    # Disable MultiViews if you are having issues with requests returning the wrong
    # page. Requires AllowOverride Options=All,MultiViews to be set here.
    # @see https://github.com/contao/core/issues/3521
    ##
    #Options -MultiViews
    
    ##
    # URL rewriting
    ##
    <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 .*\.html$ 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>
    Herzlichen Dank für Eure Hilfe,
    Christoph
    Geändert von cfauck (27.05.2017 um 14:35 Uhr)

  10. #10
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Hallo zusammen,

    bin nun weiter. Habe ein neues Contao installiert und auf die bestehende Datenbank verknüpft. Module neu installiert und file rüber kopiert.

    Nun Schritt für Schritt das URL umschreiben konfiguriert. Die weißen Seiten kommen, sobald der URL-Suffix leer ist. Muß ich den für die Verwendung von reinen Verzeichnis-URLs nicht leeren?

    -Christoph

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

    Support Contao

    Standard

    "Die Sprache zur URL hinzufügen" hast du aber schon aktiviert?

  12. #12
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.879
    Partner-ID
    10107

    Standard

    Zitat Zitat von cfauck Beitrag anzeigen
    Nun Schritt für Schritt das URL umschreiben konfiguriert. Die weißen Seiten kommen, sobald der URL-Suffix leer ist.
    Dafür musst du auch die .htaccess laut Anleitung anpassen.

  13. #13
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Hallo Spooky,

    ja, hatte ich zwischendurch gemacht.

    URL umschreiben an, Suffix leer gelassen. htaccess sah dann wie folgt aus:

    Code:
    ...
     ##
      # 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|rpm|deb)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ 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>

  14. #14
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.879
    Partner-ID
    10107

    Standard

    Das ist falsch, du musst es so machen, wie es die Anleitung sagt:
    Code:
      ##
      # 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.
      ##
    Insgesamt muss es dann so aussehen:
    Code:
      ##
      # 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|rpm|deb)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule .* index.php [L]

  15. #15
    Contao-Nutzer
    Registriert seit
    01.05.2014.
    Ort
    Reutlingen
    Beiträge
    15
    User beschenken
    Wunschliste

    Standard

    Yeahhh, danke Dir.

    Die Kommentare in der .htaccess habe ich falsch interpretiert. Ich bin davon ausgegangen, dass ich lediglich die Kommentare entfernen und nicht umstrukturieren muss.

    Habt herzlichen Dank,
    Christoph

  16. #16
    Alter Contao-Hase Avatar von kischd
    Registriert seit
    25.06.2009.
    Ort
    Karlsruhe
    Beiträge
    1.106

    Standard Mal wieder Umschreiben von URLs

    Wir haben bei einer Seite nachträglich eine zweite Sprache mit eingebaut.

    Nun wollen wir natürlich auch das Länderkürzel /de bzw. /en in die URL einbauen.

    In der htaccess sollte ich nun ja die URL wieder umschreiben lassen.

    gibt es irgendeine Erleichterung, dass ich nicht jede einzelne url mit /de eintragen muss?

    also
    Redirect 301 /aktuelles /de/aktuelles

    Oder muss ich jede einzelne auflisten?
    Gruß Mark

  17. #17
    Community-Moderator
    Wandelndes Contao-Lexikon
    Avatar von Spooky
    Registriert seit
    12.04.2012.
    Ort
    Scotland
    Beiträge
    33.879
    Partner-ID
    10107

    Standard

    Du kannst mit einer Regex (RedirectMatch bspw.) überprüfen, ob am Anfang der Request URL ein /de/ oder /en/ steht - und wenn nicht leitest du dementsprechend weiter.

  18. #18
    Alter Contao-Hase Avatar von kischd
    Registriert seit
    25.06.2009.
    Ort
    Karlsruhe
    Beiträge
    1.106

    Standard

    Kannst du mir helfen?


    Gesendet von iPhone mit Tapatalk
    Gruß Mark

  19. #19
    Alter Contao-Hase Avatar von kischd
    Registriert seit
    25.06.2009.
    Ort
    Karlsruhe
    Beiträge
    1.106

    Standard

    Bin jetzt hier https://www.google.de/amp/s/www.aska...rectmatch/amp/ Blick aber nicht ganz durch


    Gesendet von iPhone mit Tapatalk
    Gruß Mark

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
  •