Contao-Camp 2024
Ergebnis 1 bis 17 von 17

Thema: Url ohne Suffix aufrufen

  1. #1
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard Url ohne Suffix aufrufen

    Hallo Community,

    Ich habe eine kleine Frage zum Suffix. Ich bin zwar kurz vor dem durchbruch, jedoch bin ich mit nicht ganz sicher ob das so alles stimmt.

    Ich möchte meine Seite nicht nur so:

    www.meinedomain.de/nachrichten.html sondern so
    www.meinedomain.de/nachrichten

    also ohne Suffix aufrufen.

    Ich betreibe Contao in keinem Unterverzeichnis.

    Soweit ich weiß kann ich dies in der .htaccess einstellen.

    Meine Datei sieht wiefolgt 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 .* index.php [L]          # No URL suffix
      #   RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
      #
      # 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.
      ##
      RewriteRule .*\.html$ index.php [L]
    Nun bin ich mir nicht sicher was ich verändern muss. Und die beudeutung des mod_cache ist mir auch nicht ganz klar.

    Hoffe auf eure Hilfe

    Liebe Grüße

    Cristal

  2. #2
    Administrator Avatar von xchs
    Registriert seit
    19.06.2009.
    Beiträge
    14.555
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Hallo Cristal,

    eigentlich steht es ja bereits im Kommentar, wie die Änderung genau auszusehen hat. So sollte es funktionieren:
    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 .* index.php [L]          # No URL suffix
      #   RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
      #
      # 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.
      ##
      # RewriteRule .*\.html$ index.php [L]
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  3. #3
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard

    Guten Abend Xchs,

    Die Änderung bewirkt das kein Suffix mehr in meiner Url aufgeführt wird. (Zumindest nicht wen ich direkt du Unterseite aufrufe). Das ist so in Ordnung so lange keine Nachteile enstehen (Suchmaschine).

    Optimal für mich wäre jedoch folgendes Verhalten.

    Ich rufe die Seite auf mit www.meinedomain.de/news und werden dann zu der Seite www.meinedomain.de/news.html weitergeleitet. Der Stuffix in der URL macht nichts (ist erwünscht). Nur beim Eingeben der URL ist er störend.

    Liebe Grüße und vielen Dank

    Cristal

  4. #4
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard

    Gab es zum Umschreiben der URL eine änderung?

    Trotz folgendem Eintag in der .htaccess

    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 second
      # 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.
      ##
      RewriteRule .* index.php [L]
    Muss ich an die Seite .html hängen, ohne das .html bekomme ich die Meldung

    "Page not found"

    Ich habe in den Einstellungen imemr noch URL umschreiben aktviert.

    Liebe Grüße

    Cristal

  5. #5
    Administrator Avatar von xchs
    Registriert seit
    19.06.2009.
    Beiträge
    14.555
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Wenn Du keinen URL-Suffix verwenden möchtest, dann müsste es 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 second
      # 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.
      ##
      # RewriteRule .* index.php [L]
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  6. #6
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard

    Hallo Contao'ler,

    Ich muss dieses Thema nochmal hochholen, da es mir einfach nicht gelingt meine Seiten ohne Suffix aufzurufen.
    Egal welche der vorgeschlagenen Versionen ich in meine .htaccess schreibe, es funktioniert einfach nicht die Seite aufzurufen.

    Meine .htaccess

    HTML-Code:
    ##
    # Contao Open Source CMS
    # Copyright (C) 2005-2012 Leo Feyer
    #
    # Formerly known as TYPOlight Open Source CMS.
    #
    # This program is free software: you can redistribute it and/or
    # modify it under the terms of the GNU Lesser General Public
    # License as published by the Free Software Foundation, either
    # version 3 of the License, or (at your option) any later version.
    #
    # This program is distributed in the hope that it will be useful,
    # but WITHOUT ANY WARRANTY; without even the implied warranty of
    # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    # Lesser General Public License for more details.
    #
    # You should have received a copy of the GNU Lesser General Public
    # License along with this program. If not, please visit the Free
    # Software Foundation website at <http://www.gnu.org/licenses/>.
    #
    # PHP version 5
    # @copyright  Leo Feyer 2005-2012
    # @author     Leo Feyer <http://www.contao.org>
    # @license    LGPL
    ##
    
    ##
    # Disable ETags
    # @see http://developer.yahoo.com/performance/rules.html#etags
    ##
    FileETag None
    <IfModule mod_headers.c>
      Header unset ETag
    </IfModule>
    
    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      Order allow,deny
      Deny from all
    </FilesMatch>
    
    ##
    # Set the proper MIME types
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_mime.c>
      # JavaScript
      AddType application/javascript              js jsonp
      AddType application/json                    json
      # Audio
      AddType audio/ogg                           oga ogg
      AddType audio/mp4                           m4a f4a f4b
      # Video
      AddType video/ogg                           ogv
      AddType video/mp4                           mp4 m4v f4v f4p
      AddType video/webm                          webm
      AddType video/x-flv                         flv
      # SVG
      AddType image/svg+xml                       svg svgz
      AddEncoding gzip                            svgz
      # Webfonts
      AddType application/vnd.ms-fontobject       eot
      AddType application/x-font-ttf              ttf ttc
      AddType font/opentype                       otf
      AddType application/x-font-woff             woff
      # Assorted types
      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>
      # Current Apache versions (>= 2.2)
      <IfModule filter_module>
        FilterDeclare   COMPRESS
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/html
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/css
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/plain
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $text/x-component
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/javascript
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/json
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/xhtml+xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/rss+xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/atom+xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/vnd.ms-fontobject
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/svg+xml
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $image/x-icon
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $application/x-font-ttf
        FilterProvider  COMPRESS  DEFLATE resp=Content-Type $font/opentype
        FilterChain     COMPRESS
        FilterProtocol  COMPRESS  DEFLATE change=yes;byteranges=no
      </IfModule>
      # Legacy Apache versions
      <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
      ExpiresByType text/cache-manifest           "access plus 0 seconds"
      ExpiresByType text/html                     "access plus 0 seconds"
      # Data
      ExpiresByType text/xml                      "access plus 0 seconds"
      ExpiresByType application/xml               "access plus 0 seconds"
      ExpiresByType application/json              "access plus 0 seconds"
      # Feed
      ExpiresByType application/rss+xml           "access plus 1 hour"
      ExpiresByType application/atom+xml          "access plus 1 hour"
      # Media: images, video, audio
      ExpiresByType image/gif                     "access plus 1 month"
      ExpiresByType image/png                     "access plus 1 month"
      ExpiresByType image/jpg                     "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"
      # HTC files  (css3pie)
      ExpiresByType text/x-component              "access plus 1 month"
      # Webfonts
      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"
      # CSS and JavaScript
      ExpiresByType text/css                      "access plus 1 year"
      ExpiresByType application/javascript        "access plus 1 year"
    </IfModule>
    
    ##
    # 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
    ##
    <IfModule mod_headers.c>
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    </IfModule>
    
    ##
    # 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-2.11.0
      #   RewriteBase /path/to/contao
      #
      # Depending on your server, you might have to remove the line entirely.
      ##
      RewriteBase /
    
      ##
      # Uncomment the following lines and replace "domain.com" with your domain
      # name to redirect requests without "www" to the correct domain.
      ##
      #RewriteCond %{HTTP_HOST} ^domain\.com [NC]
      #RewriteRule (.*) http://www.domain.com/$1 [R=301,L]
    
    
      ##
      # 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 "text/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]
    
      ##
      # Do not rewrite requests for static files or folders such as style sheets,
      # images, movies or text documents. Do not add the URL suffix here!
      ##
      <FilesMatch "\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|eot|woff|svg|ttf|pdf|gz)$">
        RewriteEngine Off
      </FilesMatch>
    
      ##
      # 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 second
      # 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.
      ##
      # 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 an empty URL
      # to the front end controller, the second one adds a missing trailing slash.
      ##
      RewriteRule ^[a-z]{2}/$ index.php [L]
      RewriteRule ^([a-z]{2})$ $1/ [R=301,L]
    
    </IfModule>
    Bei den Einstellungen habe ich unter Frontend-Einstellungen

    URL-Suffix: .html angegeben

    URLs umschreiben habe ich aktiviert.

    Hoffe auf eure Hilfe

    Cristal

  7. #7
    Contao-Urgestein
    Registriert seit
    10.07.2010.
    Beiträge
    4.403
    User beschenken
    Wunschliste

    Standard

    Hallo Cristal,

    Du willst die .html Suffixe anzeigen aber trotzdem sollte es für Dich möglich sein die URL ohne Suffix aufzurufen?

    Bsp:

    http://www.contao-pool.de/ceris

    http://www.contao-pool.de/ceris.html

    richtig?

    Das Würde mich auch interessieren ob das möglich ist, resp. wie das einzustellen ist.


  8. #8
    Administrator Avatar von xchs
    Registriert seit
    19.06.2009.
    Beiträge
    14.555
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Zitat Zitat von Cristal Beitrag anzeigen
    Bei den Einstellungen habe ich unter Frontend-Einstellungen

    URL-Suffix: .html angegeben
    Du solltest das bestehende URL-Suffix aus diesem Feld löschen, wenn Du Webseiten ohne URL-Suffix ausliefern möchtest.
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  9. #9
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard

    Die Seite darf (soll) mit Suffix ausgeliefert werden.

    Ich möchte nur das sie auch ohne Suffix aufrufbar ist.

    Freundliche Grüße

  10. #10
    Administrator Avatar von xchs
    Registriert seit
    19.06.2009.
    Beiträge
    14.555
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Kannst Du das mal probieren?

    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 second
      # line to prevent URLs that point to folders from being rewritten (see #4031).
      #
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteCond %{REQUEST_URI} !(\.|/$)
      RewriteRule ^(.*)$ /$1.html [R=301,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} !-f
      RewriteRule .*\.html$ index.php [L]
    Und in den Systemeinstellungen sicherstellen, dass dort im Feld "URL-Suffix" die Erweiterung ".html" eingetragen ist.
    Geändert von xchs (17.08.2012 um 21:40 Uhr)
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  11. #11
    Contao-Nutzer
    Registriert seit
    16.05.2010.
    Beiträge
    212

    Standard

    Zu später Stunde doch noch was gerissen

    Es klappt hervoragend, genau so habe ich es mir vorgestellt.

    Vielen Dank

  12. #12
    Contao-Urgestein Avatar von Andreas
    Registriert seit
    19.06.2009.
    Ort
    Mönchengladbach
    Beiträge
    7.703
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Evtl. könnte das so gehen
    Code:
      RewriteCond %{REQUEST_FILENAME} !.*\.html$
      RewriteRule (.*)$ $1.html [L,R=301]
    
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ index.php [L]
    Vorher aber alles wieder auf .html einstellen.

    edit: ups, da war schon einer vor mir, naja, dann gibt es jetzt 2 Lösungen
    Geändert von Andreas (17.08.2012 um 23:04 Uhr)
    Bitte!
    Vor Anfragen im Forum HTML validieren.
    Codesnippets hier im Froum sauber einrücken. Nur Tabs o. nur Leerzeichen verwenden.

    Vielen Dank an alle Wunschlistenerfüller
    Andreas Burg, Web Solutions

  13. #13
    Contao-Urgestein Avatar von tblumrich
    Registriert seit
    25.06.2009.
    Ort
    Feldberger Seenlandschaft
    Beiträge
    2.225
    Partner-ID
    7979
    User beschenken
    Wunschliste

    Standard

    Hi.

    Ich sag auch mal danke... so eine Lösung hab ich auch hin und wieder gesucht.

    Wenn eine solche Einstellung keinen negativen Aspekt hat, würde ich sogar soweit gehen, das das Standardeinstellung in der htaccess sein sollte...
    ...daher mal eine blöde Frage: Stichwort DC - Für Google ist das egal, oder? Google sieht ja nur das Ergebnis der Weiterleitung... richtig?

    Gruß
    Thomas
    blucomp | Webdesign & Onlinelösungen

  14. #14
    Contao-Urgestein Avatar von Andreas
    Registriert seit
    19.06.2009.
    Ort
    Mönchengladbach
    Beiträge
    7.703
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Ohne html wird ja permanent weitergeleitet auf mit html, d.h. die Seite ohne gibt es nicht, also kein Problem für Suchmaschinen.

    Meine Lösung !.*\.html$ ist wohl nicht so gut wie die von xchs !(\.|/$). example.org/contao/ geht mit meiner z.B. nicht.
    !.*\.html$ - wenn der Dateiname nicht mit .html endet.
    !(\.|/$) - wenn die URI keinen Punkt enthält oder nicht mit einem Slash endet.
    Bitte!
    Vor Anfragen im Forum HTML validieren.
    Codesnippets hier im Froum sauber einrücken. Nur Tabs o. nur Leerzeichen verwenden.

    Vielen Dank an alle Wunschlistenerfüller
    Andreas Burg, Web Solutions

  15. #15
    Contao-Nutzer Avatar von Tastaturberuf
    Registriert seit
    14.03.2011.
    Ort
    Berlin
    Beiträge
    197
    User beschenken
    Wunschliste

    Standard

    Ich würde das ganze gerne mit und ohne Slash am Ende verwenden.

    also
    domain.tld/blog
    domain.tld/blog/ (Hier bekomme ich den Contao-Fehler „Seite nicht gefunden“ )

    Github macht das auch so und DC interessiert an dieser Stelle nicht, da Google weiß das es das gleiche Dokument ist.
    Der Header liefert außerdem den MIME-Type aus so das es sich niemals um einen Ordner handeln kann.

    Aktuell verwende ich das Snippet:

    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .* index.php [L]
    Contao 3.2.3

  16. #16
    Contao-Urgestein Avatar von Andreas
    Registriert seit
    19.06.2009.
    Ort
    Mönchengladbach
    Beiträge
    7.703
    User beschenken
    Wunschliste
    Contao-Projekt unterstützen

    Support Contao

    Standard

    Evtl. so
    Code:
      
    RewriteCond %{REQUEST_FILENAME} .*/$
    RewriteRule (.*)/$ $1 [L,R=301]
    
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule .* index.php [L]
    Bitte!
    Vor Anfragen im Forum HTML validieren.
    Codesnippets hier im Froum sauber einrücken. Nur Tabs o. nur Leerzeichen verwenden.

    Vielen Dank an alle Wunschlistenerfüller
    Andreas Burg, Web Solutions

  17. #17
    Alter Contao-Hase Avatar von bizon
    Registriert seit
    16.06.2010.
    Beiträge
    1.123

    Standard

    Oder du lieferst die Seiten generell mit einem Slash am Ende aus, dann ist es auch egal, wie die URL eingegeben wird.
    Code:
      ##
      # Setzt einen slash (/) ans Ende der Url
      ##
      RewriteCond %{REQUEST_URI} ^/[^\.]+[^/]$
      RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1/ [R=301,L]
    Das muss vor den Eintrag in deinem Post #15

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
  •