Ergebnis 1 bis 22 von 22

Thema: URL umschreiben

  1. #1
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard URL umschreiben

    Hallo zusammen! Erstmal allen ein schönes ruhiges Ostern! Vermutlich liegt es an meiner kalorienblockade, aber ich finde auch im Forum oder in der Suchmaschine gerade keine Lösung.

    Hab die Contao-Installation in /contao liegen. Bei dem Aufruf der Domain wird direkt in den Ordner weitergeleitet.

    Leider habe ich permanent folgende URL:

    xxx.de/index.php/produkt.html

    Wie krieg ich index.php aus der URL!

    Vielen Dank zusammen und noch ruhige Tage!

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

    Support Contao

    Standard

    Wenn das kein Contao 4 ist, dann musst du einfach im Backend unter System->Eiinstellungen URLs umschreiben anhaken und im Installationsverzeichnis die .htaccess.default in .htaccess umberennen (oder zu kopieren).

  3. #3
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard

    Vielen Dank für die superschnelle Antwort. Leider finde ich nur eine .htaccess in /contao.

    DANKE!

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

    Support Contao

    Standard

    /contao ist ja wohl dein Installationsverzeichnis?!?. Einigermaßen unglückliche Namenswahl jedenfalls, weil dann darin ja nochmal ein Verzeichnis contao existiert.

  5. #5
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard

    Ja Tab, die Argumentation sehe ich ein, recht hast. Leider hab ich in diesem /contao/contao KEINE weitere .htaccess

    Grüße

  6. #6
    Contao-Urgestein Avatar von fiedsch
    Registriert seit
    09.07.2009.
    Ort
    München
    Beiträge
    2.949

    Standard

    Die angesprochene .htaccess (bzw. in einer frischen Installation, in der noch nichts gemacht wurde die .htccess.default) sollte in Deinem Fall im Verzeichnis contao liegen. Im Unterverzeichnis contao (contao/contao bei Dir) liegt keine .htaccess. Wenn Du sagst, Du findest nur eine .htaccess, dann wurde die .htaccess.default bereits (von Dir?) umbenannt und evtl. auch bearbeitet. Was steht denn dort drin? Oder: funktioniert das URL-umschreiben bereits nachdem Du die Option im Backend gewählt hast?
    Contao-Community-Treff Bayern: http://www.contao-bayern.de

  7. #7
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard

    Hallo Fiedsch! Grüße aus Franken! Danke für Deine Antwort. Nein, ich habe die .htaccess nicht angerührt. Ich habe Contao über die Softwareinstallation bei All-Inkl installiert. Ggf. wurde dies hier schon entsprechend geändert. Das steht derzeit drin. Ziel sollte sein das nur xxx.de/Produkte als URL kommt. Das wäre super!

    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>
    Vielen Dank!

  8. #8
    Contao-Urgestein Avatar von fiedsch
    Registriert seit
    09.07.2009.
    Ort
    München
    Beiträge
    2.949

    Standard

    Das schaut soweit richtig aus. Daher nochmal die Frage

    funktioniert das URL-umschreiben bereits nachdem Du die Option im Backend gewählt hast?
    Contao-Community-Treff Bayern: http://www.contao-bayern.de

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

    Support Contao

    Standard

    Die Datei sieht eigentlich korrekt aus. Damit und mit der Einstellung im Backend sollte es eigentlich funktionieren. Eventuell nochmal die diversen Caches löschen, vielleicht stehen da ja noch irgendwo alte Daten drin.

  10. #10
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard

    Danke nochmal an alle!

    Ich kriege folgende Meldung beim Aufruf nach der Aktivierung im Backend:


    Code:
    Not Found
    The requested URL /index.php was not found on this server.
    Es wird nichts mehr angezeigt.

    Rufe ich das Backend wieder über /contao/contao auf geht dies.

    Grüße

  11. #11
    Contao-Urgestein Avatar von fiedsch
    Registriert seit
    09.07.2009.
    Ort
    München
    Beiträge
    2.949

    Standard

    Du schreibst oben (in #1)

    Zitat Zitat von peter8500 Beitrag anzeigen
    Hab die Contao-Installation in /contao liegen. Bei dem Aufruf der Domain wird direkt in den Ordner weitergeleitet.

    Leider habe ich permanent folgende URL:

    xxx.de/index.php/produkt.html

    Zitat Zitat von peter8500 Beitrag anzeigen
    Rufe ich das Backend wieder über /contao/contao auf geht dies.
    Das passt für mich nicht zusammen. Das Backend sollte gemäß #1 in xxx.de/contao/ erreichbar sein (und nicht unter contao/contao/).

    Edit: oder das Fontend unter xxx.de/contao/index.php/produkt.html
    Geändert von fiedsch (16.04.2017 um 20:35 Uhr)
    Contao-Community-Treff Bayern: http://www.contao-bayern.de

  12. #12
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard

    Da hab ich mich falsch ausgedrückt. Mein Hauptordner ist leider auch contao. Also erreiche ich das Backend über /contao/contao.

    Grüße

  13. #13
    Contao-Urgestein Avatar von fiedsch
    Registriert seit
    09.07.2009.
    Ort
    München
    Beiträge
    2.949

    Standard

    Ok, falsch verstanden Ich dachte, Du lässt die Domain auf den Ordener contao/ zeigen -- was Du ja noch im Konfigurationstool Deines Hosters ändern könntest.

    Mit der aktuellen Einstellung benötigst Du

    Code:
      RewriteBase /contao
    in der .htaccess.

    Wenn Du die Domain auf den Ordner contao zeigen lässt, dann musst Du das natürlich wieder in RewriteBase / ändern.
    Contao-Community-Treff Bayern: http://www.contao-bayern.de

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

    Support Contao

    Standard

    Am Anfang hattest du geschrieben, dass die Domain in deinen Installationsverzeichnis /contao weitergeleitet wird. Wenn das so ist, dann muss die RewriteBase so bleiben wie sie ist ("RewriteBase /"). Du solltest dann auch mal schauen, dass in der system/config/pathconfig.php drinsteht return ''; und nicht etwa return '/contao';
    Ansonsten das /contao da rauslöschen und speichern. Alternativ kannst du auch die install.php aufrufen, dann wird das automatisch richtig gesetzt. Eventuell musst du auch in deinem Browser noch das Session-Cookie für deine Domain löschen, da können sonst gelegentlich auch lustige Sachen passieren wenn sich der Pfad geändert hat in der URL.

  15. #15
    Contao-Nutzer Avatar von DetlefT
    Registriert seit
    25.07.2014.
    Ort
    Bedburg
    Beiträge
    104

    Standard

    Hallo,

    ich hänge mich mal mit in den Thread, weil mein Problem imho hier sehr gut zu passt.

    Ich möchte eine URL in der Art xxx.de/termine.

    hierzu habe ich folgende Einstellungen im Backend gemacht:

    frontend-einstellungen.png

    Die .htaccess sieht so aus (.default umbenannt, am Anfang die Error-Code-Zeilen eingefügt):

    Code:
    ##
    # Contao Open Source CMS
    #
    # Copyright (c) 2005-2016 Leo Feyer
    #
    # @license LGPL-3.0+
    ##
    
    
    ## 2017-04-10, dt
    ## Fehlerseite für den 404 – Seite nicht gefunden
    ErrorDocument 404 /par/index.php
    
    
    ##
    # 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>
    Damit funktioniert fast alles wunderbar. Es wird zu xxx.de/termine umgeschrieben, ebenso alle andere Unterseiten.

    Ein Haken bleibt: Auf der Terminseite habe ich das Eventmenu und den Eventlister eingebaut. Der erste Aufruf erfolgt ohne weitere Parameter - alles gut. Wähle ich im Eventmenü einen beliebigen Punkt, wird korrekt die URL gebildet, z.B. xxx.de/termine?month=201710, steht so auch in der Browser-Adresszeile, allerdings wird die Seite immer so wie ohne Parameter aufgerufen, sprich der Parameter wird nicht beachtet.

    Vorsichtshalber: ich entwickle z.Zt. unter der neuesten XAMPP-Version unter PHP 7.1.1, die Installation liegt unter htdocs/par/. Bis auf den einen Punkt funktioniert alles, egal ob die Rewrite-Base auf / oder /par steht. Install-Tool aufgerufen, komplette Systemwartung im Backend, alle Cookies gelöscht.

    Hat einer der Cracks eine Lösung? Danke für Eure Aufmerksamkeit!
    Viele Grüße, DetlefT

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

    Standard

    Zitat Zitat von DetlefT Beitrag anzeigen
    Damit funktioniert fast alles wunderbar. Es wird zu xxx.de/termine umgeschrieben, ebenso alle andere Unterseiten.
    Das kann eigentlich nicht sein, weil du hast diesen Teil nicht wie beschrieben angepasst:
    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)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ index.php [L]

  17. #17
    Contao-Nutzer Avatar von DetlefT
    Registriert seit
    25.07.2014.
    Ort
    Bedburg
    Beiträge
    104

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Das kann eigentlich nicht sein, weil du hast diesen Teil nicht wie beschrieben angepasst:
    ...
    Hallo Spooky,

    dann muss es am "eigentlich" liegen! Sorry, ich kapiere es nicht.
    Ich habe:
    Code:
       RewriteRule .*\.html$ index.php [L]   # URL suffix .html
       RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
       RewriteRule .*\.json$ index.php [L]   # URL suffix .json
    einzeln oder in Kombi auskommentiert oder nicht: Beide Varianten funktionieren, außer die Parameter-URL.

    Ich habe:
    Code:
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule .* index.php [L]
    auskommentiert oder nicht: Startseite funktioniert, Rest nicht. Allerdings verstehe ich
    # 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).
    nicht. Ich soll eine 3. Zeile einfügen, allerdings sind das 2 Zeilen und wo sind die beiden vorherigen Zeilen (alles, was in dem Abschnitt der .htaccess steht, besteht aus mehr oder weniger als 2 Zeilen)?

    Ich habe:
    Code:
         RewriteRule (.*\.html)$ index.php/$1 [L]
    auskommentiert oder nicht: Beide Varianten funktionieren, außer die Parameter-URL.
    Viele Grüße, DetlefT

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

    Standard

    Zitat Zitat von DetlefT Beitrag anzeigen
    Ich habe:
    Code:
       RewriteRule .*\.html$ index.php [L]   # URL suffix .html
       RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
       RewriteRule .*\.json$ index.php [L]   # URL suffix .json
    einzeln oder in Kombi auskommentiert oder nicht:
    Nein, du darfst das nicht einfach auskommentieren. Lies dir den Kommentar Block nochmal genauer durch. Ein/auskommentieren darfst du nur an Stellen, wo das auch explizit so gesagt wird.

    Wenn du kein URL Suffix verwendest, muss dieser Block:
    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)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ index.php [L]
    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)$
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule .* index.php [L]

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

    Support Contao

    Standard

    Da hast du die Kommentare in der .htaccess falsch verstanden. Sie sind auch sehr missverständlich und stammen vielleicht noch aus einer Zeit, als unter dem Kommentarblock wohl nur zwei Zeilen standen. Oder es sind die zwei RewriteConds gemeint. Lies es einfach als "du brauchst da noch eine zusätzliche Zeile/RewriteCond".
    Du sollst da auch nicht einfach das Kommentarzeichen wegmachen, das muss die Zeilen unterhalb des Kommentars ersetzen bzw ergänzen. Letztlich sollte es für URLs ohne Suffix so aussehen unterhalb des Kommentarblocks:
    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]

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

    Standard

    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).
    »
    Code:
    Line 1:  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)$
    Line 2:  RewriteCond %{REQUEST_FILENAME} !-f
    Line 3:  RewriteCond %{REQUEST_FILENAME} !-d
    Line 4:  RewriteRule .* index.php [L]

  21. #21
    Contao-Nutzer Avatar von DetlefT
    Registriert seit
    25.07.2014.
    Ort
    Bedburg
    Beiträge
    104

    Standard

    Naja, außer dem Insert muss dann auch noch die RewriteRule von
    RewriteRule .*\.html$ index.php [L]
    nach
    RewriteRule .* index.php [L]
    geändert werden. .htaccess ist halt nix für Dummies ... Im Nachhiniein betrachtet sind mir die Kommentare jetzt auch klar(er).

    Außerdem musste ich die RewriteBase jetzt noch auf /par setzen - aber: alles funktioniert nun, wie es soll. **daumenhoch**

    You made my day (und der ist ja noch einigermaßen jung)!
    Viele Grüße, DetlefT

  22. #22
    Contao-Nutzer
    Registriert seit
    08.06.2014.
    Ort
    Schnaittach
    Beiträge
    12

    Standard Vielen Dank!

    Nochmals vielen Dank für Eure Hilfestellungen & Lösungen. Funzt perfekt!

    Viele Grüße

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
  •