Ergebnis 1 bis 22 von 22

Thema: Urls umschreiben...

  1. #1
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard Urls umschreiben...

    Hallo,

    ich versuche schon den ganzen Tag Urls ohne index.php anzeigen zu lassen.
    1) In den Einstellungen "Urls umschreiben" das Häckchen gesetzt - an der Stelle kommt Fehler 404 bei Versuch die Unterseiten aufzumachen
    2) Im Hauptverzeichnis die Datei .htaccsess.default in .htaccsess umbennant und Rewrite Regeln angepasst. An der Stelle öffnet sich nichts mehr, weder meine Seite noch Contao...Es kommt folgende Mitteilung raus:
    Internal Server Error

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

    Please contact the server administrator, support@hostingsociety.com and inform them of the time the error occurred, and anything you might have done that may have caused the error.

    More information about this error may be available in the server error log.
    Hier ist meine .htaccsess Datei:
    PHP-Code:
    ##
    # Contao Open Source CMS

    # Copyright (C) 2005-2012 Leo Feyer

    # @package Core
    # @link    http://contao.org
    # @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
    ##

    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      
    Order allow,deny
      Deny from all
    </FilesMatch>

    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(ttf|ttc|otf|eot|woff|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
      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
    AddHandler x
    -httpd-php5 .php
    </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>

    ##
    # Disable caching during development
    # @see https://github.com/contao/core/issues/4364
    ##
    #<IfModule mod_headers.c>
    #  Header unset Cache-Control
    #  Header append Cache-Control must-revalidate
    #</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
    #
    # 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)$">
    #
    # For more information see: https://github.com/contao/core/issues/4364
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(js|css|xml|gz)$">
        
    Header append Vary Accept-Encoding
      
    </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 to redirect domains without "www" to the "www" subdomain.
      ##
      #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
      #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##
      # Uncomment to redirect domains with "www" to the empty domain.
      ##
      #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      #RewriteRule ^ http://%1%{REQUEST_URI} [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!
      #
      # 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:htm|php|js|css| … |gz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      
    <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/$[L]
      
    #
      # Note that not all environments support mod_rewrite and mod_cache.
      ##
      
    RewriteCond %{REQUEST_FILENAME} !-d
    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
    Ich habe Contao 3.0.0.
    Hilft mir bitte mein Fehler zu finden.

    Liebe Grüße,
    Nataliya
    Geändert von Nataliya (04.12.2012 um 14:09 Uhr)

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

    Support Contao

    Standard

    Kommentiere mal die Zeile RewriteRule (.*\.html)$ index.php/$1 [L] in der ".htaccess" aus, indem Du am Beginn ein Kommentarzeichen # einfügst.
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  3. #3
    Gesperrt
    Registriert seit
    03.04.2010.
    Ort
    Mosbach
    Beiträge
    338

    Standard

    Hast du die wirklich in .htaccsess umbenannt?

  4. #4
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Kommentiere mal die Zeile RewriteRule (.*\.html)$ index.php/$1 [L] in der ".htaccess" aus, indem Du am Beginn ein Kommentarzeichen # einfügst.
    gemacht - funktioniert immer noch nicht


    Zitat Zitat von Oden;
    Hast du die wirklich in .htaccsess umbenannt?
    Ist in Wirklichkeit ".htaccess". Hab mich im Forum verschrieben.

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

    Support Contao

    Standard

    Irgendwas muss jetzt aber falsch sein in der ".htaccess", da nun ein Error 500 vom Server gemeldet wird. Was genau hast Du denn geändert bzw. wie schaut Deine aktuelle ".htaccess" aus?
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  6. #6
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Irgendwas muss jetzt aber falsch sein in der ".htaccess", da nun ein Error 500 vom Server gemeldet wird. Was genau hast Du denn geändert bzw. wie schaut Deine aktuelle ".htaccess" aus?
    Ich habe einfach wieder im Hauptverzeichnis die default Datei gelöscht und die .htaccess hochgeladen. Wie im ersten Beitrag geschrieben - wenn ich das mache funktioniert bei mir nichts mehr, weder die Seite noch Contao Backend.
    Hier ist die Datei .htaccess:

    PHP-Code:

    # PHP als FastCGI wegen Contao SMH
    AddHandler php5-fastcgi .php
    ##
    # Contao Open Source CMS

    # Copyright (C) 2005-2012 Leo Feyer

    # @package Core
    # @link    http://contao.org
    # @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
    ##

    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      
    Order allow,deny
      Deny from all
    </FilesMatch>

    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(ttf|ttc|otf|eot|woff|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
      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
    AddHandler x
    -httpd-php5 .php
    </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>

    ##
    # Disable caching during development
    # @see https://github.com/contao/core/issues/4364
    ##
    #<IfModule mod_headers.c>
    #  Header unset Cache-Control
    #  Header append Cache-Control must-revalidate
    #</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
    #
    # 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)$">
    #
    # For more information see: https://github.com/contao/core/issues/4364
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(js|css|xml|gz)$">
        
    Header append Vary Accept-Encoding
      
    </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 to redirect domains without "www" to the "www" subdomain.
      ##
      #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
      #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##
      # Uncomment to redirect domains with "www" to the empty domain.
      ##
      #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      #RewriteRule ^ http://%1%{REQUEST_URI} [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!
      #
      # 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:htm|php|js|css| … |gz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      
    <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.
      ##

      
    RewriteCond %{REQUEST_FILENAME} !-
      RewriteRule 
    .*\.htmlindex.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

  7. #7
    Contao-Nutzer
    Registriert seit
    01.11.2012.
    Ort
    Kiel
    Beiträge
    109

    Standard

    Warum hast du diese Zeile eingefügt - wird das bei deinem Hoster benötigt?
    Code:
    AddHandler x-httpd-php5 .php
    Die RewriteRule, die du aktiviert hast, ist eigentlich dafür gedacht, wenn im Backend das Feld "URL-Suffix" leer gelassen wird.
    Steht dort bei dir wirklich nichts drin, oder steht dort ".html" drin? Im letzteren Fall wäre die Standard-RewriteRule von Contao richtig:
    Code:
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ index.php [L]

    EDIT: beachte in der RewriteCond das "!-f" - bei dir steht "!-d"!
    (Ersteres bedeutet "wenn zu der angefragten URL keine Datei gefunden wurde", letzteres "wenn zu der ang. URL kein Verzeichnis gefunden wurde")
    Geändert von MartinG (04.12.2012 um 17:01 Uhr)

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

    Support Contao

    Standard

    Du schaltest mittels AddHandler php5-fastcgi .php auf FastCGI um. Bei welchem Provider/Hoster ist denn die Site gehostet?

    Weiters hattest Du ja im Backend in den "Einstellungen" den URL-Suffix gelöscht und die Option "URLs umschreiben" aktiviert. Demnach müsstest Du Deine ".htaccess" gemäß den Kommentaren anpassen, d.h.
    Code:
      RewriteCond %{REQUEST_FILENAME} !-d 
      RewriteRule .*\.html$ index.php [L]
    deaktivieren und
    Code:
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule .* index.php [L]
    aktivieren (sprich das Kommentarzeichen # entfernen)
    Geändert von xchs (04.12.2012 um 17:08 Uhr)
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  9. #9
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Du schaltest mittels AddHandler php5-fastcgi .php auf FastCGI um. Bei welchem Provider/Hoster ist denn die Site gehostet?

    Weiters hattest Du ja im Backend in den "Einstellungen" den URL-Suffix gelöscht und die Option "URLs umschreiben" aktiviert. Demnach müsstest Du Deine ".htaccess" gemäß den Kommentaren anpassen, d.h.
    Code:
      RewriteCond %{REQUEST_FILENAME} !-d 
      RewriteRule .*\.html$ index.php [L]
    deaktivieren und
    Code:
       RewriteCond %{REQUEST_FILENAME} !-d
       RewriteRule .* index.php [L]
    aktivieren (sprich das Kommentarzeichen # entfernen)
    Die Umschaltung auf FastCGI habe ich irgenwo gelesen in der Anleitung zur Erstellung von .htaccess Datei. Habe schon mit und ohne probiert...
    Die Seite ist bei www.hostingsociety.com gehostet - ein kostenloser Webhosting.
    Ich habe die .htaccess angepasst wie du sagtest, im Hauptverzeichnis die Datei ersetzt, und wieder nichts
    Hier noch mal alles aktuell:

    PHP-Code:
    ##
    # Contao Open Source CMS

    # Copyright (C) 2005-2012 Leo Feyer

    # @package Core
    # @link    http://contao.org
    # @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
    ##

    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      
    Order allow,deny
      Deny from all
    </FilesMatch>

    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(ttf|ttc|otf|eot|woff|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
      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
    AddHandler x
    -httpd-php5 .php
    </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>

    ##
    # Disable caching during development
    # @see https://github.com/contao/core/issues/4364
    ##
    #<IfModule mod_headers.c>
    #  Header unset Cache-Control
    #  Header append Cache-Control must-revalidate
    #</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
    #
    # 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)$">
    #
    # For more information see: https://github.com/contao/core/issues/4364
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(js|css|xml|gz)$">
        
    Header append Vary Accept-Encoding
      
    </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 to redirect domains without "www" to the "www" subdomain.
      ##
      #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
      #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##
      # Uncomment to redirect domains with "www" to the empty domain.
      ##
      #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      #RewriteRule ^ http://%1%{REQUEST_URI} [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!
      #
      # 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:htm|php|js|css| … |gz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      
    <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.
      ##

    RewriteCond %{REQUEST_FILENAME} !-
    RewriteRule 
    .*\.htmlindex.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

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

    Support Contao

    Standard

    Zitat Zitat von Nataliya Beitrag anzeigen
    Die Umschaltung auf FastCGI habe ich irgenwo gelesen in der Anleitung zur Erstellung von .htaccess Datei.
    Ob die AddHandler-Direktive bei Dir auch tatsächlich notwendig ist oder nicht, kann ich nicht sagen. Das müsstest Du bei Deinem Hoster in Erfahrung bringen. Diese Direktive ist aber meist unterschiedlich von Provider zu Provider. Also lass das mal weg.

    Der Abschnitt für die Umschreibung sollte bei Dir 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.
      ##
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond %{REQUEST_FILENAME} !-d
      RewriteRule .* index.php [L]
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  11. #11
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von MartinG Beitrag anzeigen
    Warum hast du diese Zeile eingefügt - wird das bei deinem Hoster benötigt?
    Code:
    AddHandler x-httpd-php5 .php
    Die RewriteRule, die du aktiviert hast, ist eigentlich dafür gedacht, wenn im Backend das Feld "URL-Suffix" leer gelassen wird.
    Steht dort bei dir wirklich nichts drin, oder steht dort ".html" drin? Im letzteren Fall wäre die Standard-RewriteRule von Contao richtig:
    Code:
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule .*\.html$ index.php [L]

    EDIT: beachte in der RewriteCond das "!-f" - bei dir steht "!-d"!
    (Ersteres bedeutet "wenn zu der angefragten URL keine Datei gefunden wurde", letzteres "wenn zu der ang. URL kein Verzeichnis gefunden wurde")
    Wie schon oben geschriebn wurde - habe mit und ohne
    Code:
    AddHandler x-httpd-php5 .php
    probiert. Das Feld "URL-Suffix" ist leer.
    Das mit "!-d habe ich nicht ganz verstanden - bin ein Neuling und von Beruf was ganz IT-fremdes Soll ich da was machen oder ist es nur zu beachten?

  12. #12
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Ob die AddHandler-Direktive bei Dir auch tatsächlich notwendig ist oder nicht, kann ich nicht sagen. Das müsstest Du bei Deinem Hoster in Erfahrung bringen. Diese Direktive ist aber meist unterschiedlich von Provider zu Provider. Also lass das mal weg.

    Der Abschnitt für die Umschreibung sollte bei Dir so aussehen:
    Habe rauskopiert und ersetzt. Passiert nix( Soll ich dir per PN meine Zugangsdaten bei Contao zuschicken? Evtl. kannst du da was besser sehen?
    Die Datei sieht grad so aus:
    PHP-Code:
    ##
    # Contao Open Source CMS

    # Copyright (C) 2005-2012 Leo Feyer

    # @package Core
    # @link    http://contao.org
    # @license http://www.gnu.org/licenses/lgpl-3.0.html LGPL
    ##

    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      
    Order allow,deny
      Deny from all
    </FilesMatch>

    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(ttf|ttc|otf|eot|woff|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
      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
    AddHandler x
    -httpd-php5 .php
    </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>

    ##
    # Disable caching during development
    # @see https://github.com/contao/core/issues/4364
    ##
    #<IfModule mod_headers.c>
    #  Header unset Cache-Control
    #  Header append Cache-Control must-revalidate
    #</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
    #
    # 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)$">
    #
    # For more information see: https://github.com/contao/core/issues/4364
    ##
    <IfModule mod_headers.c>
      <
    FilesMatch "\.(js|css|xml|gz)$">
        
    Header append Vary Accept-Encoding
      
    </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 to redirect domains without "www" to the "www" subdomain.
      ##
      #RewriteCond %{HTTP_HOST} !^www\..+$ [NC]
      #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##
      # Uncomment to redirect domains with "www" to the empty domain.
      ##
      #RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
      #RewriteRule ^ http://%1%{REQUEST_URI} [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!
      #
      # 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:htm|php|js|css| … |gz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      
    <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.
      ##
      
    RewriteCond %{REQUEST_FILENAME} !-f
      RewriteCond 
    %{REQUEST_FILENAME} !-d
      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

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

    Support Contao

    Standard

    Für mich sieht das jetzt korrekt aus. Möglicherweise braucht es aber doch noch eine AddHandler-Direktive. Woher hattest Du denn den Eintrag, den Du ursprünglich in der ".htaccess" stehen hattest?

    Könntest Du bitte mal im Contao-Hauptverzeichnis eine Datei "phpinfo.php" erstellen mit folgendem Inhalt:
    PHP-Code:
    <?php phpinfo(); ?>
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  14. #14
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Für mich sieht das jetzt korrekt aus. Möglicherweise braucht es aber doch noch eine AddHandler-Direktive. Woher hattest Du denn den Eintrag, den Du ursprünglich in der ".htaccess" stehen hattest?

    Könntest Du bitte mal im Contao-Hauptverzeichnis eine Datei "phpinfo.php" erstellen mit folgendem Inhalt:
    PHP-Code:
    <?php phpinfo(); ?>

    Das mit der AddHandler-Direktive habe ich aus dem Contao-Buch, Kapitel 4. Habe das Buch heute für eine halbe Stunde ausgeliehen bekommen. Weiss nicht mehr wer der Autor war, aber die Ausgabe war aktuell von 2012.
    Die phpinfo Datei habe ich. Wird aber zugänglich wenn ich die .htaccess aus dem Verzeichnis lösche. Also lösche ich es wieder mal...

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

    Support Contao

    Standard

    Ja, kannst Du wieder löschen. PHP läuft bereits in der Version 5.3.10 und per FastCGI.
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  16. #16
    Contao-Nutzer
    Registriert seit
    01.11.2012.
    Ort
    Kiel
    Beiträge
    109

    Standard

    Oh, du hattest in der ursprünglichen .htaccess-Datei sogar zwei Mal einen Handler für .php eingetragen, das hatte ich übersehen.

    In deiner aktuellen .htaccess (Posting von 18.35 Uhr) ist noch immer folgender Handler drin:
    PHP-Code:
    <IfModule mod_mime.c
    ...
    AddHandler x-httpd-php5 .php 
    </IfModule
    Kommentier diese Zeile "AddHandler" bitte noch einmal aus und probiere es erneut.

    Ausserdem wäre es interessant, welche Fehlermeldung(en) der Webserver in sein Fehlerlog schreibt. Hast du Zugriff auf diese Logdatei (beim Apache-Webserver heisst sie meist error.log)? Denn in dieses Fehlerlog gehen weitere Informationen, wenn der Webserver einen HTTP Error 500 anzeigt.

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

    Support Contao

    Standard

    Ja, MartinG hat Recht. Diese Direktive sollte dort nicht stehen.

    Darüber hinaus gibt es laut Contao-Check noch einige Fehler, die Du korrigieren solltest. Folgende Dateien müsstest Du nochmals neu hochladen:
    Code:
    files/tinymce.css
    system/.htaccess
    system/tmp/.htaccess
    templates/.htaccess
    
    system/helper/ide_compat.php
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

  18. #18
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von MartinG Beitrag anzeigen
    Oh, du hattest in der ursprünglichen .htaccess-Datei sogar zwei Mal einen Handler für .php eingetragen, das hatte ich übersehen.

    In deiner aktuellen .htaccess (Posting von 18.35 Uhr) ist noch immer folgender Handler drin:
    PHP-Code:
    <IfModule mod_mime.c
    ...
    AddHandler x-httpd-php5 .php 
    </IfModule
    Kommentier diese Zeile "AddHandler" bitte noch einmal aus und probiere es erneut.

    Ausserdem wäre es interessant, welche Fehlermeldung(en) der Webserver in sein Fehlerlog schreibt. Hast du Zugriff auf diese Logdatei (beim Apache-Webserver heisst sie meist error.log)? Denn in dieses Fehlerlog gehen weitere Informationen, wenn der Webserver einen HTTP Error 500 anzeigt.
    Das auskommentieren von AddHandler hat wieder nichts gebracht. Zugang zu error.log habe ich leider nicht

    xchs - Danke, werde ich gleich hochladen!

  19. #19
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Standard

    Zitat Zitat von xchs Beitrag anzeigen
    Ja, MartinG hat Recht. Diese Direktive sollte dort nicht stehen.

    Darüber hinaus gibt es laut Contao-Check noch einige Fehler, die Du korrigieren solltest. Folgende Dateien müsstest Du nochmals neu hochladen:
    Code:
    files/tinymce.css
    system/.htaccess
    system/tmp/.htaccess
    templates/.htaccess
    
    system/helper/ide_compat.php
    Vorsichtshalber eine Frage - Ist es ok wenn ich diese Dateien aus der Version 3.0.1 hochlade, obwohl ich die Version 3.0.0. habe? Habe die Originaldateien von 3.0.0. auf diesem Rechner nicht und habe schon die 3.0.1. downgeloadet.
    (Man möge mir meine Noobigkeit verzeihen

  20. #20
    Contao-Nutzer
    Registriert seit
    19.11.2012.
    Ort
    Berlin
    Beiträge
    26

    Gesicht zeigt die Zunge

    Zitat Zitat von xchs Beitrag anzeigen
    Ja, MartinG hat Recht. Diese Direktive sollte dort nicht stehen.

    Darüber hinaus gibt es laut Contao-Check noch einige Fehler, die Du korrigieren solltest. Folgende Dateien müsstest Du nochmals neu hochladen:
    Code:
    files/tinymce.css
    system/.htaccess
    system/tmp/.htaccess
    templates/.htaccess
    
    system/helper/ide_compat.php
    Alle Dateien neu hochgeladen - hat nichts gebracht

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

    Support Contao

    Standard

    Anbei ein Archiv mit den fehlenden Dateien, die Du 1:1 so hochladen kannst.
    Angehängte Dateien Angehängte Dateien
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

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

    Support Contao

    Standard

    Als Info für alle, die hier mitlesen: Habe bei Nataliya eine ".htaccess" erstellt und dort lediglich die bereits hier im Thread besprochenen Änderungen eingefügt. Die Umschreibung der URLs läuft jetzt.
    Contao Community Administrator

    [Unterstützungsmöglichkeiten]

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
  •