Ergebnis 1 bis 6 von 6

Thema: Contao URL Rewriting in Verbindung mit IIS 7.5

  1. #1
    Contao-Nutzer Avatar von Der_Ritter
    Registriert seit
    21.06.2009.
    Beiträge
    106

    Standard Contao URL Rewriting in Verbindung mit IIS 7.5

    Hallo zusammen,

    wir verwenden das Contao CMS für die Hilfeseiten einer hausinternen Software. Leider musste aufgrund einer Neuinstallation des IIS Servers Contao neu konfiguriert werden. Nun besteht das Problem, dass das URL Rewriting nicht mehr funktioniert. Schalte ich das URL Rewriting aus (siehe Screenshot), funktioniert alles tadellos. Der Zugriff über index.php in Verbindung mit der Seiten-ID geht. Der Aufruf über den Alias jedoch nicht.
    CEinstellungen.png

    Bitte um Hilfe!

    Danke schon einmal im Voraus!

    Grüße
    Der_Ritter

    Informationen:
    Server: MS Server 2008 R2
    IIS: 7.5
    PHP: 5.3.10
    Contao: 2.11.16
    Frontend Einstellungen: URLs umschreiben


    HTACCESS
    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
    
    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      Order allow,deny
      Deny from all
    </FilesMatch>
    
    <IfModule mod_mime.c>
    
      ##
      # Serve the correct content type for .htc files (CSS3 PIE)
      # @see http://css3pie.com/documentation/known-issues/#content-type
      ##
      AddType text/x-component .htc
    
    </IfModule>
    
    <IfModule mod_deflate.c>
    
      ##
      # Use mod_deflate to compress JavaScript, CSS, XML, HTML and PHP files.
      # @see http://developer.yahoo.com/performance/rules.html#gzip
      ##
      <FilesMatch "\.(css|js|xml|html?|php)$">
        SetOutputFilter DEFLATE
      </FilesMatch>
    
    </IfModule>
    
    <IfModule mod_headers.c>
    
      ##
      # Disable ETags
      # @see http://developer.yahoo.com/performance/rules.html#etags
      ##
      Header unset ETag
    
      ##
      # 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
      ##
      <FilesMatch "\.(js|css|xml|gz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    
    </IfModule>
    
    <IfModule mod_expires.c>
    
      ##
      # Activate the module
      ##
      ExpiresActive On
    
      ##
      # Specify an expiration 30 days in the future for images, JavaScripts and
      # CSS files. Edit or remove the lines to set up your own expiration logic.
      # @see http://developer.yahoo.com/performance/rules.html#expires
      ##
      ExpiresByType image/png A2592000
      ExpiresByType image/gif A2592000
      ExpiresByType image/jpg A2592000
      ExpiresByType image/jpeg A2592000
      ExpiresByType text/javascript A2592000
      ExpiresByType application/x-javascript A2592000
      ExpiresByType application/javascript A2592000
      ExpiresByType text/css A2592000
      ExpiresByType image/x-icon A2592000
    
    </IfModule>
    
    <IfModule mod_rewrite.c>
    
      ##
      # Activate the module
      ##
      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 "\.(png|gif|jpe?g|js|css|ico|php|xml|csv|txt|gz|swf|flv|eot|woff|svg|ttf|htm)$">
        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
      #   RewriteRule .* index.php [L]          # No URL suffix
      #
      # 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 (.*\.html)$ index.php/$1 [L]
      
      RewriteRule .*\.html$ index.php [L,QSA]
      #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 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>
    Web.config
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <configuration>
        <system.webServer>
            <rewrite>
                <rules>
                    <rule name="Imported Rule 1" enabled="true" stopProcessing="true">
                        <match url=".*\.html$" ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                    <rule name="Imported Rule 2" enabled="true" stopProcessing="true">
                        <match url="^[a-z]{2}/$" ignoreCase="false" />
                        <action type="Rewrite" url="index.php" />
                    </rule>
                    <rule name="Imported Rule 3" enabled="true" stopProcessing="true">
                        <match url="^([a-z]{2})$" ignoreCase="false" />
                        <action type="Redirect" url="{R:1}/" redirectType="Permanent" />
                    </rule>
                </rules>
            </rewrite>
            <handlers>
                <remove name="php-5.3.10" />
                <add name="php-5.3.10" path="*.php" verb="GET,HEAD,POST" modules="CgiModule" scriptProcessor="C:\Program Files (x86)\PHP\php-cgi.exe" resourceType="Either" requireAccess="Script" />
            </handlers>
            <defaultDocument>
                <files>
                    <add value="index.php/leistungsuebersicht.html" />
                </files>
            </defaultDocument>
        </system.webServer>
    </configuration>
    Geändert von Der_Ritter (28.04.2014 um 16:04 Uhr)

  2. #2
    Contao-Fan
    Registriert seit
    27.06.2012.
    Beiträge
    600

    Standard

    ich glaube mod_rewrite laeuft nur unter apache

    Gesendet von meinem GT-I9505 mit Tapatalk

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

    Support Contao

    Standard

    Musst du vielleicht mal checken, ob das URL rewrite Modul bei der Neuinstallation des Servers auch mit installiert wurde.

  4. #4
    Contao-Nutzer Avatar von Der_Ritter
    Registriert seit
    21.06.2009.
    Beiträge
    106

    Standard

    Danke für Eure Antworten!

    Zitat Zitat von valentin_ Beitrag anzeigen
    ich glaube mod_rewrite laeuft nur unter apache
    Mag sein, jedoch funktionierte die Seite schon mal unter IIS.

    Musst du vielleicht mal checken, ob das URL rewrite Modul bei der Neuinstallation des Servers auch mit installiert wurde.
    Ich check das mal und melde mich wieder.
    Grüße
    Der_Ritter

  5. #5
    Contao-Nutzer Avatar von Der_Ritter
    Registriert seit
    21.06.2009.
    Beiträge
    106

    Standard

    Kurze Info!

    PHP neu drüberkopiert, schon gings. Obwohl das notwendige Modul eigentlich schon vorher auf aktiv war.
    Das war's.

    Grüße
    Der_Ritter

  6. #6
    Contao-Fan Avatar von css-umsetzung
    Registriert seit
    13.11.2010.
    Ort
    Berlin
    Beiträge
    307

    Standard betrifft contao 3.3.x

    Hat hier irgendjemand weiterführende Infos,
    wenn man diese config oder eine ähnliche config nimmt, ist ja die Seite erstmal lauffähig wie es scheint (habe nur grundlegende Sachen getestet), aber wenn man versucht in das Backend zu kommen gibt es unweigerlich 500er Fehler.

    getestet unter einem Windows Server mit Plesk 12.5
    css-umsetzung.de

    Programmierungen im Bereich PHP, JavaScript sowie Layoutumsetzungen in HTML/CSS.
    Unterstützte Systeme: Contao, JTL, Plentymarket sowie alle XTC Basierenden Shops.
    -JTL Servicepartner- -Quicksupport über Teamview-

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
  •