Contao-Camp 2024
Seite 2 von 2 ErsteErste 12
Ergebnis 41 bis 74 von 74

Thema: URL ändern von mehreren tld auf /de /en?

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

    Standard

    Deine eigenen Redirets über die RewriteEngine musst du direkt nach RewriteEngine On geben, ansonsten werden die regulären Rewrites von Contao bzw. Symfony vorher ausgeführt.

  2. #42
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Also ich habe den code jetzt direkt unter:

    Code:
    RewriteEngine On
    Es funktioniert lieder immer noch nicht.

    Wenn ich jetzt diese Bereich entferne:
    Code:
    RewriteCond %{HTTP_HOST} domain\.com$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/en/$1 [R=301,L]
    Dann funktioniert es für die deutsche Seite, nur eben nicht für die englische aber die Seite ist wieder erreichbar.

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

    Standard

    Poste wieder deine .htaccess

  4. #44
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Code:
    <IfModule mod_deflate.c>
    	# Force compression for mangled `Accept-Encoding` request headers
    	<IfModule mod_setenvif.c>
    		<IfModule mod_headers.c>
    			SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    			RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    		</IfModule>
    	</IfModule>
    
    	# Compress all output labeled with one of the following media types.
    	#
    	# (!) For Apache versions below version 2.3.7 you don't need to
    	# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
    	# and `</IfModule>` lines as `AddOutputFilterByType` is still in
    	# the core directives.
    	#
    	# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE application/atom+xml \
    			application/javascript \
    			application/json \
    			application/ld+json \
    			application/manifest+json \
    			application/rdf+xml \
    			application/rss+xml \
    			application/schema+json \
    			application/vnd.geo+json \
    			application/vnd.ms-fontobject \
    			application/x-font-ttf \
    			application/x-javascript \
    			application/x-web-app-manifest+json \
    			application/xhtml+xml \
    			application/xml \
    			font/eot \
    			font/opentype \
    			image/bmp \
    			image/svg+xml \
    			image/vnd.microsoft.icon \
    			image/x-icon \
    			text/cache-manifest \
    			text/css \
    			text/html \
    			text/javascript \
    			text/plain \
    			text/vcard \
    			text/vnd.rim.location.xloc \
    			text/vtt \
    			text/x-component \
    			text/x-cross-domain-policy \
    			text/xml
    	</IfModule>
    
    	<IfModule mod_mime.c>
    		AddEncoding gzip              svgz
    	</IfModule>
    </IfModule>
    
    ### End: Compression ###
    
    
    
    ### Begin: Browser caching of resource files ###
    
    # This affects Frontend and Backend and increases performance.
    <IfModule mod_expires.c>
    
    	ExpiresActive on
    	ExpiresDefault                                      "access plus 1 month"
    
    	ExpiresByType text/css                              "access plus 1 year"
    
    	ExpiresByType application/json                      "access plus 0 seconds"
    	ExpiresByType application/ld+json                   "access plus 0 seconds"
    	ExpiresByType application/schema+json               "access plus 0 seconds"
    	ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    	ExpiresByType application/xml                       "access plus 0 seconds"
    	ExpiresByType text/xml                              "access plus 0 seconds"
    
    	ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
    	ExpiresByType image/x-icon                          "access plus 1 week"
    
    	ExpiresByType text/x-component                      "access plus 1 month"
    
    	ExpiresByType text/html                             "access plus 0 seconds"
    
    	ExpiresByType application/javascript                "access plus 1 year"
    	ExpiresByType application/x-javascript              "access plus 1 year"
    	ExpiresByType text/javascript                       "access plus 1 year"
    
    	ExpiresByType application/manifest+json             "access plus 1 week"
    	ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    	ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
    	ExpiresByType audio/ogg                             "access plus 1 month"
    	ExpiresByType image/bmp                             "access plus 1 month"
    	ExpiresByType image/gif                             "access plus 1 month"
    	ExpiresByType image/jpeg                            "access plus 1 month"
    	ExpiresByType image/jpg                             "access plus 1 month"
    	ExpiresByType image/png                             "access plus 1 month"
    	ExpiresByType image/svg+xml                         "access plus 1 month"
    	ExpiresByType image/webp                            "access plus 1 month"
    	ExpiresByType video/mp4                             "access plus 1 month"
    	ExpiresByType video/ogg                             "access plus 1 month"
    	ExpiresByType video/webm                            "access plus 1 month"
    
    	ExpiresByType application/atom+xml                  "access plus 1 hour"
    	ExpiresByType application/rdf+xml                   "access plus 1 hour"
    	ExpiresByType application/rss+xml                   "access plus 1 hour"
    
    	ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    	ExpiresByType font/eot                              "access plus 1 month"
    	ExpiresByType font/opentype                         "access plus 1 month"
    	ExpiresByType application/x-font-ttf                "access plus 1 month"
    	ExpiresByType application/font-woff                 "access plus 1 month"
    	ExpiresByType application/x-font-woff               "access plus 1 month"
    	ExpiresByType font/woff                             "access plus 1 month"
    	ExpiresByType application/font-woff2                "access plus 1 month"
    
    	ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    
    </IfModule>
    
    ### End: Browser caching of resource files ###
    
    
    ### Begin: MIME types ###
    
    # Proper MIME types for all files
    <IfModule mod_mime.c>
    
    	# Data interchange
    	AddType application/atom+xml                        atom
    	AddType application/json                            json map topojson
    	AddType application/ld+json                         jsonld
    	AddType application/rss+xml                         rss
    	AddType application/vnd.geo+json                    geojson
    	AddType application/xml                             rdf xml
    
    	# JavaScript
    	AddType application/javascript                      js
    
    	# Manifest files
    	AddType application/manifest+json                   webmanifest
    	AddType application/x-web-app-manifest+json         webapp
    	AddType text/cache-manifest                         appcache
    
    	# Media files
    
    	AddType audio/mp4                                   f4a f4b m4a
    	AddType audio/ogg                                   oga ogg opus
    	AddType image/bmp                                   bmp
    	AddType image/svg+xml                               svg svgz
    	AddType image/webp                                  webp
    	AddType video/mp4                                   f4v f4p m4v mp4
    	AddType video/ogg                                   ogv
    	AddType video/webm                                  webm
    	AddType video/x-flv                                 flv
    	AddType image/x-icon                                cur ico
    
    	# Web fonts
    	AddType application/font-woff                       woff
    	AddType application/font-woff2                      woff2
    	AddType application/vnd.ms-fontobject               eot
    	AddType application/x-font-ttf                      ttc ttf
    	AddType font/opentype                               otf
    
    	# Other
    	AddType application/octet-stream                    safariextz
    	AddType application/x-bb-appworld                   bbaw
    	AddType application/x-chrome-extension              crx
    	AddType application/x-opera-extension               oex
    	AddType application/x-xpinstall                     xpi
    	AddType text/vcard                                  vcard vcf
    	AddType text/vnd.rim.location.xloc                  xloc
    	AddType text/vtt                                    vtt
    	AddType text/x-component                            htc
    
    </IfModule>
    
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
      # Add language code -------------------------------------------------------------------------------
    
    	RewriteCond %{HTTP_HOST} domain\.de$ [NC]
    	RewriteRule ^(.*)$ http://dev.domain.com/de/$1 [R=301,L]
    
    	RewriteCond %{HTTP_HOST} domain\.nl$ [NC]
    	RewriteRule ^(.*)$ http://dev.domain.com/nl/$1 [R=301,L]
    
    	RewriteCond %{HTTP_HOST} domain\.fr$ [NC]
    	RewriteRule ^(.*)$ http://dev.domain.com/fr/$1 [R=301,L]
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
      # Adaptive-Images -----------------------------------------------------------------------------------
    
      # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
      # RewriteCond %{REQUEST_URI} !ignore-this-directory
      # RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
    
      # don't apply the AI behaviour to images inside AI's cache folder:
      RewriteCond %{REQUEST_URI} !ai-cache
    
      # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
      # to adaptive-images.php so we can select appropriately sized versions
    
      RewriteRule \.(?:jpe?g|gif|png)$ ai.php [L]
    
    
    
    
      # END Adaptive-Images -------------------------------------------------------------------------------
    # Adds www. to URLs without
    ##
    RewriteCond %{HTTP_HOST} ^domain\.de [NC]
    RewriteRule (.*) https://www.domain.de/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    RewriteRule (.*) https://www.domain.com/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domain\.fr [NC]
    RewriteRule (.*) https://www.domain.fr/$1 [R=301,L]
    
    RewriteCond %{HTTP_HOST} ^domain\.nl [NC]
    RewriteRule (.*) https://www.domain.nl/$1 [R=301,L]
    
    
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com/de/$
    RewriteRule sitemap.xml share/domainde.xml [L]
    
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com/en/$
    RewriteRule sitemap.xml share/domaincom.xml [L]
    
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com/fr/$
    RewriteRule sitemap.xml share/domainfr.xml [L]
    
    RewriteCond %{HTTP_HOST} ^(www.)?domain.com/nl/$
    RewriteRule sitemap.xml share/domainnl.xml [L]
    
    
    
    
    
    ##
    # Domain redirects
    ##
    RewriteCond %{SERVER_NAME} ^www\.domain-systems\.de$ [NC]
    RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domainsoftware\.de$ [NC]
    RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain-online\.de$ [NC]
    RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain.at
    RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain24\.com$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain24\.net
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain\.info$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain-online\.net$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain\.eu$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain\.dk$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain\.ag$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    RewriteCond %{SERVER_NAME} ^www\.domain\.se$ [NC]
    RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    
    
    #------------------------------------------------------------------------Pages redirect-----------------------
    
    
    #ENGLISH
    
    #FRANZÖSISCH
    
    
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>
    Problem ist jetzt:
    dev.domain.de/loesungen leitet weiter auf dev.domain.com/de/loesungen, was ja passt.
    dev.domain.com/solutions leitet aber weiter auf dev.domain.com/de/solutions, was eine 404 ausgibt, richtig wäre ja dev.domain.com/en/solutions.

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

    Standard

    Du hast immer noch Redirects über die RewriteEngine, die nicht direkt nach RewriteEngine On kommen. Darüberhinaus würde ich dir raten, die .htaccess mal aufzuräumen und korrekte Einrückungen zu benutzen, ansonsten hast du ja keinen Überblick mehr.

  6. #46
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Aber die sind doch direkt drunter:
    Bildschirmfoto 2019-05-06 um 10.19.28.png

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

    Standard

    Ja, aber du hast ja noch viel, viel mehr.

  8. #48
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Aber in der Contao .htaccess steht doch auch sehr viel mehr, weiter oben.
    Also soll ich jetzt den kompletten Bereich:
    Code:
    <IfModule mod_rewrite.c>
        RewriteEngine On
    Nach oben ziehen?

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

    Standard

    Nein, nein. Du musst alle deine eigenen Redirects, die du mit der RewriteEngine machst, direkt nach RewriteEngine On geben. Also vor den RewriteRules für Symfony.

  10. #50
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Du meinst so?
    Code:
    <IfModule mod_deflate.c>
    	# Force compression for mangled `Accept-Encoding` request headers
    	<IfModule mod_setenvif.c>
    		<IfModule mod_headers.c>
    			SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    			RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    		</IfModule>
    	</IfModule>
    
    	# Compress all output labeled with one of the following media types.
    	#
    	# (!) For Apache versions below version 2.3.7 you don't need to
    	# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
    	# and `</IfModule>` lines as `AddOutputFilterByType` is still in
    	# the core directives.
    	#
    	# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE application/atom+xml \
    			application/javascript \
    			application/json \
    			application/ld+json \
    			application/manifest+json \
    			application/rdf+xml \
    			application/rss+xml \
    			application/schema+json \
    			application/vnd.geo+json \
    			application/vnd.ms-fontobject \
    			application/x-font-ttf \
    			application/x-javascript \
    			application/x-web-app-manifest+json \
    			application/xhtml+xml \
    			application/xml \
    			font/eot \
    			font/opentype \
    			image/bmp \
    			image/svg+xml \
    			image/vnd.microsoft.icon \
    			image/x-icon \
    			text/cache-manifest \
    			text/css \
    			text/html \
    			text/javascript \
    			text/plain \
    			text/vcard \
    			text/vnd.rim.location.xloc \
    			text/vtt \
    			text/x-component \
    			text/x-cross-domain-policy \
    			text/xml
    	</IfModule>
    
    	<IfModule mod_mime.c>
    		AddEncoding gzip              svgz
    	</IfModule>
    </IfModule>
    
    ### End: Compression ###
    
    
    
    ### Begin: Browser caching of resource files ###
    
    # This affects Frontend and Backend and increases performance.
    <IfModule mod_expires.c>
    
    	ExpiresActive on
    	ExpiresDefault                                      "access plus 1 month"
    
    	ExpiresByType text/css                              "access plus 1 year"
    
    	ExpiresByType application/json                      "access plus 0 seconds"
    	ExpiresByType application/ld+json                   "access plus 0 seconds"
    	ExpiresByType application/schema+json               "access plus 0 seconds"
    	ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    	ExpiresByType application/xml                       "access plus 0 seconds"
    	ExpiresByType text/xml                              "access plus 0 seconds"
    
    	ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
    	ExpiresByType image/x-icon                          "access plus 1 week"
    
    	ExpiresByType text/x-component                      "access plus 1 month"
    
    	ExpiresByType text/html                             "access plus 0 seconds"
    
    	ExpiresByType application/javascript                "access plus 1 year"
    	ExpiresByType application/x-javascript              "access plus 1 year"
    	ExpiresByType text/javascript                       "access plus 1 year"
    
    	ExpiresByType application/manifest+json             "access plus 1 week"
    	ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    	ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
    	ExpiresByType audio/ogg                             "access plus 1 month"
    	ExpiresByType image/bmp                             "access plus 1 month"
    	ExpiresByType image/gif                             "access plus 1 month"
    	ExpiresByType image/jpeg                            "access plus 1 month"
    	ExpiresByType image/jpg                             "access plus 1 month"
    	ExpiresByType image/png                             "access plus 1 month"
    	ExpiresByType image/svg+xml                         "access plus 1 month"
    	ExpiresByType image/webp                            "access plus 1 month"
    	ExpiresByType video/mp4                             "access plus 1 month"
    	ExpiresByType video/ogg                             "access plus 1 month"
    	ExpiresByType video/webm                            "access plus 1 month"
    
    	ExpiresByType application/atom+xml                  "access plus 1 hour"
    	ExpiresByType application/rdf+xml                   "access plus 1 hour"
    	ExpiresByType application/rss+xml                   "access plus 1 hour"
    
    	ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    	ExpiresByType font/eot                              "access plus 1 month"
    	ExpiresByType font/opentype                         "access plus 1 month"
    	ExpiresByType application/x-font-ttf                "access plus 1 month"
    	ExpiresByType application/font-woff                 "access plus 1 month"
    	ExpiresByType application/x-font-woff               "access plus 1 month"
    	ExpiresByType font/woff                             "access plus 1 month"
    	ExpiresByType application/font-woff2                "access plus 1 month"
    
    	ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    
    </IfModule>
    
    ### End: Browser caching of resource files ###
    
    
    ### Begin: MIME types ###
    
    # Proper MIME types for all files
    <IfModule mod_mime.c>
    
    	# Data interchange
    	AddType application/atom+xml                        atom
    	AddType application/json                            json map topojson
    	AddType application/ld+json                         jsonld
    	AddType application/rss+xml                         rss
    	AddType application/vnd.geo+json                    geojson
    	AddType application/xml                             rdf xml
    
    	# JavaScript
    	AddType application/javascript                      js
    
    	# Manifest files
    	AddType application/manifest+json                   webmanifest
    	AddType application/x-web-app-manifest+json         webapp
    	AddType text/cache-manifest                         appcache
    
    	# Media files
    
    	AddType audio/mp4                                   f4a f4b m4a
    	AddType audio/ogg                                   oga ogg opus
    	AddType image/bmp                                   bmp
    	AddType image/svg+xml                               svg svgz
    	AddType image/webp                                  webp
    	AddType video/mp4                                   f4v f4p m4v mp4
    	AddType video/ogg                                   ogv
    	AddType video/webm                                  webm
    	AddType video/x-flv                                 flv
    	AddType image/x-icon                                cur ico
    
    	# Web fonts
    	AddType application/font-woff                       woff
    	AddType application/font-woff2                      woff2
    	AddType application/vnd.ms-fontobject               eot
    	AddType application/x-font-ttf                      ttc ttf
    	AddType font/opentype                               otf
    
    	# Other
    	AddType application/octet-stream                    safariextz
    	AddType application/x-bb-appworld                   bbaw
    	AddType application/x-chrome-extension              crx
    	AddType application/x-opera-extension               oex
    	AddType application/x-xpinstall                     xpi
    	AddType text/vcard                                  vcard vcf
    	AddType text/vnd.rim.location.xloc                  xloc
    	AddType text/vtt                                    vtt
    	AddType text/x-component                            htc
    
    </IfModule>
    
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    	  # Add language code -------------------------------------------------------------------------------
    
    		RewriteCond %{HTTP_HOST} intershop\.de$ [NC]
    		RewriteRule ^(.*)$ http://dev.domain.com/de/$1 [R=301,L]
    
    		RewriteCond %{HTTP_HOST} intershop\.nl$ [NC]
    		RewriteRule ^(.*)$ http://dev.intershop.com/nl/$1 [R=301,L]
    
    		RewriteCond %{HTTP_HOST} intershop\.fr$ [NC]
    		RewriteRule ^(.*)$ http://dev.intershop.com/fr/$1 [R=301,L]
    	
    		# Adds www. to URLs without
    		##
    		RewriteCond %{HTTP_HOST} ^domain\.de [NC]
    		RewriteRule (.*) https://www.domain.de/$1 [R=301,L]
    
    		RewriteCond %{HTTP_HOST} ^domain\.com [NC]
    		RewriteRule (.*) https://www.domain.com/$1 [R=301,L]
    
    		RewriteCond %{HTTP_HOST} ^domain\.fr [NC]
    		RewriteRule (.*) https://www.domain.fr/$1 [R=301,L]
    
    		RewriteCond %{HTTP_HOST} ^domain\.nl [NC]
    		RewriteRule (.*) https://www.domain.nl/$1 [R=301,L]
    
    
    		RewriteCond %{HTTP_HOST} ^(www.)?domain.com/de/$
    		RewriteRule sitemap.xml share/domainde.xml [L]
    
    		RewriteCond %{HTTP_HOST} ^(www.)?domain.com/en/$
    		RewriteRule sitemap.xml share/domaincom.xml [L]
    
    		RewriteCond %{HTTP_HOST} ^(www.)?domain.com/fr/$
    		RewriteRule sitemap.xml share/domainfr.xml [L]
    
    		RewriteCond %{HTTP_HOST} ^(www.)?domain.com/nl/$
    		RewriteRule sitemap.xml share/domainnl.xml [L]
    
    
    		##
    		# Domain redirects
    		##
    		RewriteCond %{SERVER_NAME} ^www\.domain-systems\.de$ [NC]
    		RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domainsoftware\.de$ [NC]
    		RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain-online\.de$ [NC]
    		RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain.at
    		RewriteRule ^ http://www.domain.de/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain24\.com$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain24\.net
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain\.info$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain-online\.net$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain\.eu$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain\.dk$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain\.ag$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    		RewriteCond %{SERVER_NAME} ^www\.domain\.se$ [NC]
    		RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    
    
    		#------------------------------------------------------------------------Pages redirect START-----------------------
    
    
    		#ENGLISH
    
    		#FRANZÖSISCH
    
    		#------------------------------------------------------------------------Pages redirect END-----------------------
    
    		# Determine the RewriteBase automatically and set it as environment variable.
    		# If you are using Apache aliases to do mass virtual hosting or installed the
    		# project in a subdirectory, the base path will be prepended to allow proper
    		# resolution of the app.php file and to redirect to the correct URI. It will
    		# work in environments without path prefix as well, providing a safe, one-size
    		# fits all solution. But as you do not need it in this case, you can comment
    		# the following 2 lines to eliminate the overhead.
    		RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
    		RewriteRule ^(.*) - [E=BASE:%1]
    
    		# Sets the HTTP_AUTHORIZATION header removed by Apache
    		RewriteCond %{HTTP:Authorization} .
    		RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
    		# Redirect to URI without front controller to prevent duplicate content
    		# (with and without `/app.php`). Only do this redirect on the initial
    		# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
    		# endless redirect loop (request -> rewrite to front controller ->
    		# redirect -> request -> ...).
    		# So in case you get a "too many redirects" error or you always get redirected
    		# to the start page because your Apache does not expose the REDIRECT_STATUS
    		# environment variable, you have 2 choices:
    		# - disable this feature by commenting the following 2 lines or
    		# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
    		#   following RewriteCond (best solution)
    		RewriteCond %{ENV:REDIRECT_STATUS} ^$
    		RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
    		# Adaptive-Images -----------------------------------------------------------------------------------
    
    		# Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
    		# RewriteCond %{REQUEST_URI} !ignore-this-directory
    		# RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
    
    		# don't apply the AI behaviour to images inside AI's cache folder:
    		RewriteCond %{REQUEST_URI} !ai-cache
    
    		# Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
    		# to adaptive-images.php so we can select appropriately sized versions
    
    		RewriteRule \.(?:jpe?g|gif|png)$ ai.php [L]
    
    		# END Adaptive-Images -------------------------------------------------------------------------------
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>

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

    Standard

    Genau. Und hier noch mit etwas besserer Formatierung:
    Code:
    <IfModule mod_deflate.c>
        # Force compression for mangled `Accept-Encoding` request headers
        <IfModule mod_setenvif.c>
            <IfModule mod_headers.c>
                SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
                RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
            </IfModule>
        </IfModule>
    
        # Compress all output labeled with one of the following media types.
        #
        # (!) For Apache versions below version 2.3.7 you don't need to
        # enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
        # and `</IfModule>` lines as `AddOutputFilterByType` is still in
        # the core directives.
        #
        # https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    
        <IfModule mod_filter.c>
            AddOutputFilterByType DEFLATE application/atom+xml \
                application/javascript \
                application/json \
                application/ld+json \
                application/manifest+json \
                application/rdf+xml \
                application/rss+xml \
                application/schema+json \
                application/vnd.geo+json \
                application/vnd.ms-fontobject \
                application/x-font-ttf \
                application/x-javascript \
                application/x-web-app-manifest+json \
                application/xhtml+xml \
                application/xml \
                font/eot \
                font/opentype \
                image/bmp \
                image/svg+xml \
                image/vnd.microsoft.icon \
                image/x-icon \
                text/cache-manifest \
                text/css \
                text/html \
                text/javascript \
                text/plain \
                text/vcard \
                text/vnd.rim.location.xloc \
                text/vtt \
                text/x-component \
                text/x-cross-domain-policy \
                text/xml
        </IfModule>
    
        <IfModule mod_mime.c>
            AddEncoding gzip              svgz
        </IfModule>
    </IfModule>
    
    ### End: Compression ###
    
    
    
    ### Begin: Browser caching of resource files ###
    
    # This affects Frontend and Backend and increases performance.
    <IfModule mod_expires.c>
    
        ExpiresActive on
        ExpiresDefault                                      "access plus 1 month"
    
        ExpiresByType text/css                              "access plus 1 year"
    
        ExpiresByType application/json                      "access plus 0 seconds"
        ExpiresByType application/ld+json                   "access plus 0 seconds"
        ExpiresByType application/schema+json               "access plus 0 seconds"
        ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
        ExpiresByType application/xml                       "access plus 0 seconds"
        ExpiresByType text/xml                              "access plus 0 seconds"
    
        ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
        ExpiresByType image/x-icon                          "access plus 1 week"
    
        ExpiresByType text/x-component                      "access plus 1 month"
    
        ExpiresByType text/html                             "access plus 0 seconds"
    
        ExpiresByType application/javascript                "access plus 1 year"
        ExpiresByType application/x-javascript              "access plus 1 year"
        ExpiresByType text/javascript                       "access plus 1 year"
    
        ExpiresByType application/manifest+json             "access plus 1 week"
        ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
        ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
        ExpiresByType audio/ogg                             "access plus 1 month"
        ExpiresByType image/bmp                             "access plus 1 month"
        ExpiresByType image/gif                             "access plus 1 month"
        ExpiresByType image/jpeg                            "access plus 1 month"
        ExpiresByType image/jpg                             "access plus 1 month"
        ExpiresByType image/png                             "access plus 1 month"
        ExpiresByType image/svg+xml                         "access plus 1 month"
        ExpiresByType image/webp                            "access plus 1 month"
        ExpiresByType video/mp4                             "access plus 1 month"
        ExpiresByType video/ogg                             "access plus 1 month"
        ExpiresByType video/webm                            "access plus 1 month"
    
        ExpiresByType application/atom+xml                  "access plus 1 hour"
        ExpiresByType application/rdf+xml                   "access plus 1 hour"
        ExpiresByType application/rss+xml                   "access plus 1 hour"
    
        ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
        ExpiresByType font/eot                              "access plus 1 month"
        ExpiresByType font/opentype                         "access plus 1 month"
        ExpiresByType application/x-font-ttf                "access plus 1 month"
        ExpiresByType application/font-woff                 "access plus 1 month"
        ExpiresByType application/x-font-woff               "access plus 1 month"
        ExpiresByType font/woff                             "access plus 1 month"
        ExpiresByType application/font-woff2                "access plus 1 month"
    
        ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    
    </IfModule>
    
    ### End: Browser caching of resource files ###
    
    
    ### Begin: MIME types ###
    
    # Proper MIME types for all files
    <IfModule mod_mime.c>
    
        # Data interchange
        AddType application/atom+xml                        atom
        AddType application/json                            json map topojson
        AddType application/ld+json                         jsonld
        AddType application/rss+xml                         rss
        AddType application/vnd.geo+json                    geojson
        AddType application/xml                             rdf xml
    
        # JavaScript
        AddType application/javascript                      js
    
        # Manifest files
        AddType application/manifest+json                   webmanifest
        AddType application/x-web-app-manifest+json         webapp
        AddType text/cache-manifest                         appcache
    
        # Media files
    
        AddType audio/mp4                                   f4a f4b m4a
        AddType audio/ogg                                   oga ogg opus
        AddType image/bmp                                   bmp
        AddType image/svg+xml                               svg svgz
        AddType image/webp                                  webp
        AddType video/mp4                                   f4v f4p m4v mp4
        AddType video/ogg                                   ogv
        AddType video/webm                                  webm
        AddType video/x-flv                                 flv
        AddType image/x-icon                                cur ico
    
        # Web fonts
        AddType application/font-woff                       woff
        AddType application/font-woff2                      woff2
        AddType application/vnd.ms-fontobject               eot
        AddType application/x-font-ttf                      ttc ttf
        AddType font/opentype                               otf
    
        # Other
        AddType application/octet-stream                    safariextz
        AddType application/x-bb-appworld                   bbaw
        AddType application/x-chrome-extension              crx
        AddType application/x-opera-extension               oex
        AddType application/x-xpinstall                     xpi
        AddType text/vcard                                  vcard vcf
        AddType text/vnd.rim.location.xloc                  xloc
        AddType text/vtt                                    vtt
        AddType text/x-component                            htc
    
    </IfModule>
    
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
    
        # Add language code -------------------------------------------------------------------------------
    
        RewriteCond %{HTTP_HOST} intershop\.de$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} intershop\.nl$ [NC]
        RewriteRule ^(.*)$ http://dev.intershop.com/nl/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} intershop\.fr$ [NC]
        RewriteRule ^(.*)$ http://dev.intershop.com/fr/$1 [R=301,L]
    
    
        # Adds www. to URLs without  ----------------------------------------------------------------------
    
        RewriteCond %{HTTP_HOST} ^domain\.de [NC]
        RewriteRule (.*) https://www.domain.de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} ^domain\.com [NC]
        RewriteRule (.*) https://www.domain.com/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} ^domain\.fr [NC]
        RewriteRule (.*) https://www.domain.fr/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} ^domain\.nl [NC]
        RewriteRule (.*) https://www.domain.nl/$1 [R=301,L]
    
    
        # Sitemaps ----------------------------------------------------------------------------------------
    
        RewriteCond %{HTTP_HOST} ^(www.)?domain.com/de/$
        RewriteRule sitemap.xml share/domainde.xml [L]
    
        RewriteCond %{HTTP_HOST} ^(www.)?domain.com/en/$
        RewriteRule sitemap.xml share/domaincom.xml [L]
    
        RewriteCond %{HTTP_HOST} ^(www.)?domain.com/fr/$
        RewriteRule sitemap.xml share/domainfr.xml [L]
    
        RewriteCond %{HTTP_HOST} ^(www.)?domain.com/nl/$
        RewriteRule sitemap.xml share/domainnl.xml [L]
    
    
        # Domain redirects  -------------------------------------------------------------------------------
    
        RewriteCond %{SERVER_NAME} ^www\.domain-systems\.de$ [NC]
        RewriteRule ^ http://www.domain.de/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domainsoftware\.de$ [NC]
        RewriteRule ^ http://www.domain.de/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain-online\.de$ [NC]
        RewriteRule ^ http://www.domain.de/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain.at
        RewriteRule ^ http://www.domain.de/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain24\.com$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain24\.net
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain\.info$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain-online\.net$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain\.eu$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain\.dk$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain\.ag$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
        RewriteCond %{SERVER_NAME} ^www\.domain\.se$ [NC]
        RewriteRule ^ http://www.domain.com/ [L,R=301]
    
    
    
        #------------------------------------------------------------------------Pages redirect START-----------------------
    
    
        #ENGLISH
    
        #FRANZÖSISCH
    
        #------------------------------------------------------------------------Pages redirect END-----------------------
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
        # Adaptive-Images -----------------------------------------------------------------------------------
    
        # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
        # RewriteCond %{REQUEST_URI} !ignore-this-directory
        # RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
    
        # don't apply the AI behaviour to images inside AI's cache folder:
        RewriteCond %{REQUEST_URI} !ai-cache
    
        # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
        # to adaptive-images.php so we can select appropriately sized versions
    
        RewriteRule \.(?:jpe?g|gif|png)$ ai.php [L]
    
        # END Adaptive-Images -------------------------------------------------------------------------------
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>

  12. #52
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Funktioniert leider immer noch nicht.

    Ich habe jetzt alle von mir eingefügten Redirects entfernt und nur Sprachcode Weiterleitungen drinnen gelassen:

    Code:
    <IfModule mod_deflate.c>
    	# Force compression for mangled `Accept-Encoding` request headers
    	<IfModule mod_setenvif.c>
    		<IfModule mod_headers.c>
    			SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    			RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    		</IfModule>
    	</IfModule>
    
    	# Compress all output labeled with one of the following media types.
    	#
    	# (!) For Apache versions below version 2.3.7 you don't need to
    	# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
    	# and `</IfModule>` lines as `AddOutputFilterByType` is still in
    	# the core directives.
    	#
    	# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE application/atom+xml \
    			application/javascript \
    			application/json \
    			application/ld+json \
    			application/manifest+json \
    			application/rdf+xml \
    			application/rss+xml \
    			application/schema+json \
    			application/vnd.geo+json \
    			application/vnd.ms-fontobject \
    			application/x-font-ttf \
    			application/x-javascript \
    			application/x-web-app-manifest+json \
    			application/xhtml+xml \
    			application/xml \
    			font/eot \
    			font/opentype \
    			image/bmp \
    			image/svg+xml \
    			image/vnd.microsoft.icon \
    			image/x-icon \
    			text/cache-manifest \
    			text/css \
    			text/html \
    			text/javascript \
    			text/plain \
    			text/vcard \
    			text/vnd.rim.location.xloc \
    			text/vtt \
    			text/x-component \
    			text/x-cross-domain-policy \
    			text/xml
    	</IfModule>
    
    	<IfModule mod_mime.c>
    		AddEncoding gzip              svgz
    	</IfModule>
    </IfModule>
    
    ### End: Compression ###
    
    
    
    ### Begin: Browser caching of resource files ###
    
    # This affects Frontend and Backend and increases performance.
    <IfModule mod_expires.c>
    
    	ExpiresActive on
    	ExpiresDefault                                      "access plus 1 month"
    
    	ExpiresByType text/css                              "access plus 1 year"
    
    	ExpiresByType application/json                      "access plus 0 seconds"
    	ExpiresByType application/ld+json                   "access plus 0 seconds"
    	ExpiresByType application/schema+json               "access plus 0 seconds"
    	ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    	ExpiresByType application/xml                       "access plus 0 seconds"
    	ExpiresByType text/xml                              "access plus 0 seconds"
    
    	ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
    	ExpiresByType image/x-icon                          "access plus 1 week"
    
    	ExpiresByType text/x-component                      "access plus 1 month"
    
    	ExpiresByType text/html                             "access plus 0 seconds"
    
    	ExpiresByType application/javascript                "access plus 1 year"
    	ExpiresByType application/x-javascript              "access plus 1 year"
    	ExpiresByType text/javascript                       "access plus 1 year"
    
    	ExpiresByType application/manifest+json             "access plus 1 week"
    	ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    	ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
    	ExpiresByType audio/ogg                             "access plus 1 month"
    	ExpiresByType image/bmp                             "access plus 1 month"
    	ExpiresByType image/gif                             "access plus 1 month"
    	ExpiresByType image/jpeg                            "access plus 1 month"
    	ExpiresByType image/jpg                             "access plus 1 month"
    	ExpiresByType image/png                             "access plus 1 month"
    	ExpiresByType image/svg+xml                         "access plus 1 month"
    	ExpiresByType image/webp                            "access plus 1 month"
    	ExpiresByType video/mp4                             "access plus 1 month"
    	ExpiresByType video/ogg                             "access plus 1 month"
    	ExpiresByType video/webm                            "access plus 1 month"
    
    	ExpiresByType application/atom+xml                  "access plus 1 hour"
    	ExpiresByType application/rdf+xml                   "access plus 1 hour"
    	ExpiresByType application/rss+xml                   "access plus 1 hour"
    
    	ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    	ExpiresByType font/eot                              "access plus 1 month"
    	ExpiresByType font/opentype                         "access plus 1 month"
    	ExpiresByType application/x-font-ttf                "access plus 1 month"
    	ExpiresByType application/font-woff                 "access plus 1 month"
    	ExpiresByType application/x-font-woff               "access plus 1 month"
    	ExpiresByType font/woff                             "access plus 1 month"
    	ExpiresByType application/font-woff2                "access plus 1 month"
    
    	ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    
    </IfModule>
    
    ### End: Browser caching of resource files ###
    
    
    ### Begin: MIME types ###
    
    # Proper MIME types for all files
    <IfModule mod_mime.c>
    
    	# Data interchange
    	AddType application/atom+xml                        atom
    	AddType application/json                            json map topojson
    	AddType application/ld+json                         jsonld
    	AddType application/rss+xml                         rss
    	AddType application/vnd.geo+json                    geojson
    	AddType application/xml                             rdf xml
    
    	# JavaScript
    	AddType application/javascript                      js
    
    	# Manifest files
    	AddType application/manifest+json                   webmanifest
    	AddType application/x-web-app-manifest+json         webapp
    	AddType text/cache-manifest                         appcache
    
    	# Media files
    
    	AddType audio/mp4                                   f4a f4b m4a
    	AddType audio/ogg                                   oga ogg opus
    	AddType image/bmp                                   bmp
    	AddType image/svg+xml                               svg svgz
    	AddType image/webp                                  webp
    	AddType video/mp4                                   f4v f4p m4v mp4
    	AddType video/ogg                                   ogv
    	AddType video/webm                                  webm
    	AddType video/x-flv                                 flv
    	AddType image/x-icon                                cur ico
    
    	# Web fonts
    	AddType application/font-woff                       woff
    	AddType application/font-woff2                      woff2
    	AddType application/vnd.ms-fontobject               eot
    	AddType application/x-font-ttf                      ttc ttf
    	AddType font/opentype                               otf
    
    	# Other
    	AddType application/octet-stream                    safariextz
    	AddType application/x-bb-appworld                   bbaw
    	AddType application/x-chrome-extension              crx
    	AddType application/x-opera-extension               oex
    	AddType application/x-xpinstall                     xpi
    	AddType text/vcard                                  vcard vcf
    	AddType text/vnd.rim.location.xloc                  xloc
    	AddType text/vtt                                    vtt
    	AddType text/x-component                            htc
    
    </IfModule>
    
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        RewriteCond %{HTTP_HOST} domain\.de$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.com$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/en/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.nl$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/nl/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.fr$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/fr/$1 [R=301,L]
    
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
          # Adaptive-Images -----------------------------------------------------------------------------------
    
          # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
          # RewriteCond %{REQUEST_URI} !ignore-this-directory
          # RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
    
          # don't apply the AI behaviour to images inside AI's cache folder:
          RewriteCond %{REQUEST_URI} !ai-cache
    
          # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
          # to adaptive-images.php so we can select appropriately sized versions
    
          RewriteRule \.(?:jpe?g|gif|png)$ ai.php [L]
    
        #END Adaptive-Images -------------------------------------------------------------------------------
    
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>
    wenn ich dev.domain.de aufrufe, werde ich auf : dev.domain.com/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/en/de/ weitergeleitet ist. Woher kommen denn die 19 mal "/en/"?

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

    Standard

    Ja, weil du redirectest ja mit ^(.*)$ alles. Du darfst ja nur redirecten, wenn die die URL nicht schon bereits mit /de/ etc. beginnt. Siehe die Posts dazu vorher.

  14. #54
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Er soll ja nur redirecten, wenn kein /de/, /en/, /nl/, /fr/ in der URL ist oder was ist das logischste?

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

    Standard

    Das haben wir ja wie gesagt hier schon besprochen.

  16. #56
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Das haben wir ja wie gesagt hier schon besprochen.
    Ich dachte, dass wäre das hier:

    Code:
    RewriteCond %{HTTP_HOST} domain\.de$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.com$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/en/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.nl$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/nl/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.fr$ [NC]
        RewriteRule ^(.*)$ http://dev.domain.com/fr/$1 [R=301,L]

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

    Standard

    Nein, da steht ja
    Code:
    RewriteRule ^(.*)$ http://dev.domain.com/en/$1
    Das heißt, du redirectest immer alles auf /en/. Das heißt https://example.com/foo wird auf https://example.com/en/foo weitergeleitet. Und https://example.com/en/foo wird auf https://example.com/en/en/foo weitergeleitet. Und https://example.com/en/en/foo wird auf https://example.com/en/en/en/foo weitergeleitet. Und https://example.com/en/en/en/foo wird auf https://example.com/en/en/en/en/foo weitergeleitet. etc.

  18. #58
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Puh ok, wie würdest du es denn machen, ist alles irgend wie neu für mich.

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

    Standard

    Eben genau so wie hier erwähnt.

  20. #60
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Also wenn ich das so mache wie hier:
    Code:
    RewriteCond %{HTTP_HOST} domain\.de$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.com$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/en/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.nl$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/nl/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.fr$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/fr/$1 [R=301,L]
    Dann werde ich immer weitergeleitet auf: dev.domain.com/en/app.php

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

    Standard

    Poste mal die komplette .htaccess inkl. dieser Änderung.

  22. #62
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Poste mal die komplette .htaccess inkl. dieser Änderung.
    Code:
    <IfModule mod_deflate.c>
    	# Force compression for mangled `Accept-Encoding` request headers
    	<IfModule mod_setenvif.c>
    		<IfModule mod_headers.c>
    			SetEnvIfNoCase ^(Accept-EncodXng|X-cept-Encoding|X{15}|~{15}|-{15})$ ^((gzip|deflate)\s*,?\s*)+|[X~-]{4,13}$ HAVE_Accept-Encoding
    			RequestHeader append Accept-Encoding "gzip,deflate" env=HAVE_Accept-Encoding
    		</IfModule>
    	</IfModule>
    
    	# Compress all output labeled with one of the following media types.
    	#
    	# (!) For Apache versions below version 2.3.7 you don't need to
    	# enable `mod_filter` and can remove the `<IfModule mod_filter.c>`
    	# and `</IfModule>` lines as `AddOutputFilterByType` is still in
    	# the core directives.
    	#
    	# https://httpd.apache.org/docs/current/mod/mod_filter.html#addoutputfilterbytype
    
    	<IfModule mod_filter.c>
    		AddOutputFilterByType DEFLATE application/atom+xml \
    			application/javascript \
    			application/json \
    			application/ld+json \
    			application/manifest+json \
    			application/rdf+xml \
    			application/rss+xml \
    			application/schema+json \
    			application/vnd.geo+json \
    			application/vnd.ms-fontobject \
    			application/x-font-ttf \
    			application/x-javascript \
    			application/x-web-app-manifest+json \
    			application/xhtml+xml \
    			application/xml \
    			font/eot \
    			font/opentype \
    			image/bmp \
    			image/svg+xml \
    			image/vnd.microsoft.icon \
    			image/x-icon \
    			text/cache-manifest \
    			text/css \
    			text/html \
    			text/javascript \
    			text/plain \
    			text/vcard \
    			text/vnd.rim.location.xloc \
    			text/vtt \
    			text/x-component \
    			text/x-cross-domain-policy \
    			text/xml
    	</IfModule>
    
    	<IfModule mod_mime.c>
    		AddEncoding gzip              svgz
    	</IfModule>
    </IfModule>
    
    ### End: Compression ###
    
    
    
    ### Begin: Browser caching of resource files ###
    
    # This affects Frontend and Backend and increases performance.
    <IfModule mod_expires.c>
    
    	ExpiresActive on
    	ExpiresDefault                                      "access plus 1 month"
    
    	ExpiresByType text/css                              "access plus 1 year"
    
    	ExpiresByType application/json                      "access plus 0 seconds"
    	ExpiresByType application/ld+json                   "access plus 0 seconds"
    	ExpiresByType application/schema+json               "access plus 0 seconds"
    	ExpiresByType application/vnd.geo+json              "access plus 0 seconds"
    	ExpiresByType application/xml                       "access plus 0 seconds"
    	ExpiresByType text/xml                              "access plus 0 seconds"
    
    	ExpiresByType image/vnd.microsoft.icon              "access plus 1 week"
    	ExpiresByType image/x-icon                          "access plus 1 week"
    
    	ExpiresByType text/x-component                      "access plus 1 month"
    
    	ExpiresByType text/html                             "access plus 0 seconds"
    
    	ExpiresByType application/javascript                "access plus 1 year"
    	ExpiresByType application/x-javascript              "access plus 1 year"
    	ExpiresByType text/javascript                       "access plus 1 year"
    
    	ExpiresByType application/manifest+json             "access plus 1 week"
    	ExpiresByType application/x-web-app-manifest+json   "access plus 0 seconds"
    	ExpiresByType text/cache-manifest                   "access plus 0 seconds"
    
    	ExpiresByType audio/ogg                             "access plus 1 month"
    	ExpiresByType image/bmp                             "access plus 1 month"
    	ExpiresByType image/gif                             "access plus 1 month"
    	ExpiresByType image/jpeg                            "access plus 1 month"
    	ExpiresByType image/jpg                             "access plus 1 month"
    	ExpiresByType image/png                             "access plus 1 month"
    	ExpiresByType image/svg+xml                         "access plus 1 month"
    	ExpiresByType image/webp                            "access plus 1 month"
    	ExpiresByType video/mp4                             "access plus 1 month"
    	ExpiresByType video/ogg                             "access plus 1 month"
    	ExpiresByType video/webm                            "access plus 1 month"
    
    	ExpiresByType application/atom+xml                  "access plus 1 hour"
    	ExpiresByType application/rdf+xml                   "access plus 1 hour"
    	ExpiresByType application/rss+xml                   "access plus 1 hour"
    
    	ExpiresByType application/vnd.ms-fontobject         "access plus 1 month"
    	ExpiresByType font/eot                              "access plus 1 month"
    	ExpiresByType font/opentype                         "access plus 1 month"
    	ExpiresByType application/x-font-ttf                "access plus 1 month"
    	ExpiresByType application/font-woff                 "access plus 1 month"
    	ExpiresByType application/x-font-woff               "access plus 1 month"
    	ExpiresByType font/woff                             "access plus 1 month"
    	ExpiresByType application/font-woff2                "access plus 1 month"
    
    	ExpiresByType text/x-cross-domain-policy            "access plus 1 week"
    
    </IfModule>
    
    ### End: Browser caching of resource files ###
    
    
    ### Begin: MIME types ###
    
    # Proper MIME types for all files
    <IfModule mod_mime.c>
    
    	# Data interchange
    	AddType application/atom+xml                        atom
    	AddType application/json                            json map topojson
    	AddType application/ld+json                         jsonld
    	AddType application/rss+xml                         rss
    	AddType application/vnd.geo+json                    geojson
    	AddType application/xml                             rdf xml
    
    	# JavaScript
    	AddType application/javascript                      js
    
    	# Manifest files
    	AddType application/manifest+json                   webmanifest
    	AddType application/x-web-app-manifest+json         webapp
    	AddType text/cache-manifest                         appcache
    
    	# Media files
    
    	AddType audio/mp4                                   f4a f4b m4a
    	AddType audio/ogg                                   oga ogg opus
    	AddType image/bmp                                   bmp
    	AddType image/svg+xml                               svg svgz
    	AddType image/webp                                  webp
    	AddType video/mp4                                   f4v f4p m4v mp4
    	AddType video/ogg                                   ogv
    	AddType video/webm                                  webm
    	AddType video/x-flv                                 flv
    	AddType image/x-icon                                cur ico
    
    	# Web fonts
    	AddType application/font-woff                       woff
    	AddType application/font-woff2                      woff2
    	AddType application/vnd.ms-fontobject               eot
    	AddType application/x-font-ttf                      ttc ttf
    	AddType font/opentype                               otf
    
    	# Other
    	AddType application/octet-stream                    safariextz
    	AddType application/x-bb-appworld                   bbaw
    	AddType application/x-chrome-extension              crx
    	AddType application/x-opera-extension               oex
    	AddType application/x-xpinstall                     xpi
    	AddType text/vcard                                  vcard vcf
    	AddType text/vnd.rim.location.xloc                  xloc
    	AddType text/vtt                                    vtt
    	AddType text/x-component                            htc
    
    </IfModule>
    
    <IfModule mod_headers.c>
        # Allow access from all domains for webfonts (see contao/core-bundle#528)
        <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
            Header set Access-Control-Allow-Origin "*"
        </FilesMatch>
    </IfModule>
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        RewriteCond %{HTTP_HOST} domain\.de$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/de/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.com$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/en/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.nl$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/nl/$1 [R=301,L]
    
        RewriteCond %{HTTP_HOST} domain\.fr$ [NC]
        RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/fr/$1 [R=301,L]
    
    
    
    
        # Determine the RewriteBase automatically and set it as environment variable.
        # If you are using Apache aliases to do mass virtual hosting or installed the
        # project in a subdirectory, the base path will be prepended to allow proper
        # resolution of the app.php file and to redirect to the correct URI. It will
        # work in environments without path prefix as well, providing a safe, one-size
        # fits all solution. But as you do not need it in this case, you can comment
        # the following 2 lines to eliminate the overhead.
        RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
        RewriteRule ^(.*) - [E=BASE:%1]
    
        # Sets the HTTP_AUTHORIZATION header removed by Apache
        RewriteCond %{HTTP:Authorization} .
        RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        # Redirect to URI without front controller to prevent duplicate content
        # (with and without `/app.php`). Only do this redirect on the initial
        # rewrite by Apache and not on subsequent cycles. Otherwise we would get an
        # endless redirect loop (request -> rewrite to front controller ->
        # redirect -> request -> ...).
        # So in case you get a "too many redirects" error or you always get redirected
        # to the start page because your Apache does not expose the REDIRECT_STATUS
        # environment variable, you have 2 choices:
        # - disable this feature by commenting the following 2 lines or
        # - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
        #   following RewriteCond (best solution)
        RewriteCond %{ENV:REDIRECT_STATUS} ^$
        RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
    
          # Adaptive-Images -----------------------------------------------------------------------------------
    
          # Add any directories you wish to omit from the Adaptive-Images process on a new line, as follows:
          # RewriteCond %{REQUEST_URI} !ignore-this-directory
          # RewriteCond %{REQUEST_URI} !and-ignore-this-directory-too
    
          # don't apply the AI behaviour to images inside AI's cache folder:
          RewriteCond %{REQUEST_URI} !ai-cache
    
          # Send any GIF, JPG, or PNG request that IS NOT stored inside one of the above directories
          # to adaptive-images.php so we can select appropriately sized versions
    
          RewriteRule \.(?:jpe?g|gif|png)$ ai.php [L]
    
        #END Adaptive-Images -------------------------------------------------------------------------------
    
    
        # If the requested filename exists, simply serve it.
        # We only want to let Apache serve files and not directories.
        RewriteCond %{REQUEST_FILENAME} -f
        RewriteRule ^ - [L]
    
        # Rewrite all other queries to the front controller.
        RewriteRule ^ %{ENV:BASE}/app.php [L]
    </IfModule>
    
    
    <IfModule !mod_rewrite.c>
        <IfModule mod_alias.c>
            # When mod_rewrite is not available, we instruct a temporary redirect of
            # the start page to the front controller explicitly so that the website
            # and the generated links can still be used.
            RedirectMatch 302 ^/$ /app.php/
            # RedirectTemp cannot be used instead
        </IfModule>
    </IfModule>

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

    Standard

    Sollte so stimmen.

  24. #64
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Sollte so stimmen.
    Und trotzdem geht es immer von dev.domain.de auf: dev.domain.com/en/app.php, oder auch von dev.domain.com auf: dev.intershop.com/en/app.php

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

    Standard

    Also du bekommst vom Server tatsächlich einen Response wo im Response Header Location: https://dev.intershop.com/en/app.php steht? Kann ich mir nicht erklären (und zumindest über einen .htaccess Tester nicht nachvollziehen).

  26. #66
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Die Adresszeile wechselt von dev.domain.de auf: dev.domain.com/en/app.php.

    Ärgert mich selber, dass ich mich damit Null auskenne.

    Hatte hier auch mal einen Tester:
    https://htaccess.madewithlove.be?sha...0-f2bf68cc7809

  27. #67
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Könnte es sonst noch irgend wo Einstellungen zu Weiterleitungen geben? Server, Contao, Hoster?

  28. #68
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Hi Spooky, gibt es denn eine Möglichkeit, die Automatische Weiterleitung anhand der Browsersprache aus zu schalten?

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

    Standard

    Grundsätzlich nicht. Aber warum möchtest du das abschalten?

  30. #70
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Meine .de bzw com/de/ klappt, nur die .com/en nicht. http://dev.domain.com/solutions leitet immer auf http://dev.domain.com/de/solutions im Firefox (Browsersprache deutsch)
    Weiter. In meinem Opera (Browsersprache englisch) leitet http://dev.domain.com/solutions immer auf http://dev.domain.com/en/solutions richtig weiter.

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

    Standard

    Ja, dafür brauchst du ja deine eigenen Redirect Regeln. Alle Anfragen, die auf dev.domain.com gehen, ohne Sprackürzel im Request Path, sollen auf /en/… weitergeleitet werden.

  32. #72
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Ja, dafür brauchst du ja deine eigenen Redirect Regeln. Alle Anfragen, die auf dev.domain.com gehen, ohne Sprackürzel im Request Path, sollen auf /en/… weitergeleitet werden.
    Genau und wenn ich das mache:
    RewriteCond %{HTTP_HOST} domain\.com$ [NC]
    RewriteRule ^((?![a-z]{2}/).*)$ http://dev.domain.com/en/$1 [R=301,L]

    Wird immer weitergeleitet auf: http://dev.domain.com/en/app.php
    Bildschirmfoto 2019-05-08 um 15.48.27.png

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

    Standard

    Ja, das hast du schon erwähnt. Ich kann aber momentan keinen Fehler feststellen und nicht nachvollziehen, wo das Problem liegt.

    Dazu müsste ich mich näher mit dem Problem befassen. Wie du an der Länge des Threads sehen kannst, ist das alles keine ganz so triviale Sache. Daher wäre es vielleicht besser, wenn du dir bezahlte Unterstützung holst.

  34. #74
    Contao-Fan
    Registriert seit
    13.12.2012.
    Beiträge
    621

    Standard

    Zitat Zitat von Spooky Beitrag anzeigen
    Ja, das hast du schon erwähnt. Ich kann aber momentan keinen Fehler feststellen und nicht nachvollziehen, wo das Problem liegt.

    Dazu müsste ich mich näher mit dem Problem befassen. Wie du an der Länge des Threads sehen kannst, ist das alles keine ganz so triviale Sache. Daher wäre es vielleicht besser, wenn du dir bezahlte Unterstützung holst.
    Ja, dass stimmt, hättest du denn Lust und Zeit für einen Auftrag?

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
  •