Ergebnis 1 bis 10 von 10

Thema: Seiten der Hautpdomain auch über Subdomain erreichbar

  1. #1
    Contao-Nutzer
    Registriert seit
    20.08.2017.
    Beiträge
    28

    Standard Seiten der Hautpdomain auch über Subdomain erreichbar

    Liebe Contao Gemeinde,

    ich verwalte in einer Contao Installation 3 Domains. Davon 1 Hauptdomain und 2 Subdomains.
    Jede der Domains hat einen eigenen Startpunkt und eine eigene Seitenstruktur, ein eigenes fe_page und eigene Layouts.
    Im Startpunkt sind jeweils die DNS Angaben für die jeweiligen Domains/Subdomains angegeben.

    Folgendes verstehe ich nicht und finde auch keinen Ansatzpunkt für den Fehler:
    Alle Seiten der Hauptdomain sind auch über die 1. Subdomain erreichbar, also subdomain1.hauptdomain.de/seite1
    Aber seite1 gibt es unter dem Seitenbaum der subdomain1 überhaupt nicht. Bei der 2. Subdomain tritt dieses Phänomen nicht auf.
    Ich bin ratlos, was dieses Problem betrifft. Hat jemand irgendeinen Ansatzpunkt für mich, was ich noch überprüfen muss oder vergessen habe? Ich habe auch schon beide Subdomains miteinander verglichen, kann aber keine Unterschiede feststellen, außer dass von der Hauptdomain ein Link auf die 1. Subdomain gesetzt ist (was aber das Problem nicht verursachen kann, denke ich).

    Bin für Hinweise dankbar.
    VG, Christina

  2. #2
    Contao-Urgestein Avatar von Samson1964
    Registriert seit
    05.11.2012.
    Ort
    Berlin
    Beiträge
    2.794

    Standard

    Deine Seitenstruktur mit den eingetragenen Adressen sieht also so aus?
    Code:
    Startpunkt 1 = hauptdomain.de
    Startpunkt 2 = subdomain1.hauptdomain.de
    Startpunkt 3 = subdomain2.hauptdomain.de
    Das funktioniert zumindest bei mir einwandfrei, wobei ich Startpunkt 1 mit www.hauptdomain.de aufrufe und in der .htaccess hauptdomain.de auf www.hauptdomain.de umleite. Sind in Deiner .htaccess irgendwelche Umleitungen von subdomain1.hauptdomain.de auf hauptdomain.de aktiv?
    Viele Grüße
    Frank

    Seit Mai 2013 Fan von Contao
    Webmaster vom Deutschen Schachbund und Berliner Schachverband
    Mein Blog: Schachbulle
    Meine Erweiterungen bei GitHub
    Meine Videos auf YouTube: Playlist zur Contao-Programmierung/Einrichtung

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

    Support Contao

    Standard

    Eventuell könnte sowas durch das Rewrite oder Redirect in der .htaccess passieren, je nachdem wie das bei dir aussieht. Kannst ja mal deine .htaccess hier reinstellen, dann kann man das schnell als Ursache identifizieren oder ausschliessen. Reicht auch mit anonymisierter Domain/Subdomain, solange die Subdomains/Domains alle voneinander unterscheidbar bleiben

  4. #4
    Contao-Nutzer
    Registriert seit
    20.08.2017.
    Beiträge
    28

    Standard

    @Samson1964: Ja, ganz genauso sieht alles bei mir aus. Umleitungen von Sub- auf Hauptdomain gibt es auch keine.

    @tab: hier ist meine .htaccess

    Code:
    ##
    ##
    # Prevent access to the Contao template files
    ##
    <FilesMatch "\.(tpl|html5|xhtml)$">
      <IfModule !mod_authz_core.c>
        Order deny,allow
        Deny from all
      </IfModule>
      <IfModule mod_authz_core.c>
        Require all denied
      </IfModule>
    </FilesMatch>
    
    ##
    # Allow access from all domains for webfonts
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_headers.c>
      <FilesMatch "\.(ttf|ttc|otf|eot|woff2?|font\.css)$">
        Header set Access-Control-Allow-Origin "*"
      </FilesMatch>
    </IfModule>
    
    ##
    # Disable ETags
    # @see http://developer.yahoo.com/performance/rules.html#etags
    ##
    FileETag None
    <IfModule mod_headers.c>
      Header unset ETag
    </IfModule>
    
    ##
    # Set the proper MIME types
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_mime.c>
      AddType application/javascript              js jsonp
      AddType application/json                    json
      AddType audio/ogg                           oga ogg
      AddType audio/mp4                           m4a f4a f4b
      AddType video/ogg                           ogv
      AddType video/mp4                           mp4 m4v f4v f4p
      AddType video/webm                          webm
      AddType video/x-flv                         flv
      AddType image/svg+xml                       svg svgz
      AddEncoding gzip                            svgz
      AddType application/vnd.ms-fontobject       eot
      AddType application/x-font-ttf              ttf ttc
      AddType font/opentype                       otf
      AddType application/x-font-woff             woff woff2
      AddType image/x-icon                        ico
      AddType image/webp                          webp
      AddType text/cache-manifest                 appcache manifest
      AddType text/x-component                    htc
      AddType application/xml                     rss atom xml rdf
      AddType application/x-web-app-manifest+json webapp
      AddType text/x-vcard                        vcf
      AddType application/x-shockwave-flash       swf
    </IfModule>
    
    ##
    # Gzip compression
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_deflate.c>
      <IfModule mod_filter.c>
        AddOutputFilterByType DEFLATE text/html text/plain text/css application/json
        AddOutputFilterByType DEFLATE application/javascript
        AddOutputFilterByType DEFLATE text/xml application/xml text/x-component
        AddOutputFilterByType DEFLATE application/xhtml+xml application/rss+xml application/atom+xml
        AddOutputFilterByType DEFLATE image/x-icon image/svg+xml application/vnd.ms-fontobject application/x-font-ttf font/opentype
      </IfModule>
    </IfModule>
    
    ##
    # Expires headers (for better cache control)
    # @see https://github.com/h5bp/html5-boilerplate
    ##
    <IfModule mod_expires.c>
      ExpiresActive on
    
      ##
      # Productional website
      ##
      ExpiresByType text/cache-manifest           "access plus 0 seconds"
      ExpiresByType text/html                     "access plus 0 seconds"
      ExpiresByType text/xml                      "access plus 0 seconds"
      ExpiresByType application/xml               "access plus 0 seconds"
      ExpiresByType application/json              "access plus 0 seconds"
      ExpiresByType application/rss+xml           "access plus 1 hour"
      ExpiresByType application/atom+xml          "access plus 1 hour"
      ExpiresByType image/gif                     "access plus 1 month"
      ExpiresByType image/png                     "access plus 1 month"
      ExpiresByType image/jpeg                    "access plus 1 month"
      ExpiresByType image/x-icon                  "access plus 1 month"
      ExpiresByType video/ogg                     "access plus 1 month"
      ExpiresByType audio/ogg                     "access plus 1 month"
      ExpiresByType video/mp4                     "access plus 1 month"
      ExpiresByType video/webm                    "access plus 1 month"
      ExpiresByType text/x-component              "access plus 1 month"
      ExpiresByType application/x-font-ttf        "access plus 1 month"
      ExpiresByType font/opentype                 "access plus 1 month"
      ExpiresByType application/x-font-woff       "access plus 1 month"
      ExpiresByType image/svg+xml                 "access plus 1 month"
      ExpiresByType application/vnd.ms-fontobject "access plus 1 month"
      ExpiresByType text/css                      "access plus 1 year"
      ExpiresByType application/javascript        "access plus 1 year"
    
      ##
      # Disable caching during development
      # @see https://github.com/contao/core/issues/4364
      ##
      #ExpiresByType text/cache-manifest           "access"
      #ExpiresByType text/html                     "access"
      #ExpiresByType text/xml                      "access"
      #ExpiresByType application/xml               "access"
      #ExpiresByType application/json              "access"
      #ExpiresByType application/rss+xml           "access"
      #ExpiresByType application/atom+xml          "access"
      #ExpiresByType image/gif                     "access"
      #ExpiresByType image/png                     "access"
      #ExpiresByType image/jpeg                    "access"
      #ExpiresByType image/x-icon                  "access"
      #ExpiresByType video/ogg                     "access"
      #ExpiresByType audio/ogg                     "access"
      #ExpiresByType video/mp4                     "access"
      #ExpiresByType video/webm                    "access"
      #ExpiresByType text/x-component              "access"
      #ExpiresByType application/x-font-ttf        "access"
      #ExpiresByType font/opentype                 "access"
      #ExpiresByType application/x-font-woff       "access"
      #ExpiresByType image/svg+xml                 "access"
      #ExpiresByType application/vnd.ms-fontobject "access"
      #ExpiresByType text/css                      "access"
      #ExpiresByType application/javascript        "access"
    
    </IfModule>
    
    ##
    # Header adjustments
    ##
    <IfModule mod_headers.c>
    
      ##
      # Disable caching during development
      # @see https://github.com/contao/core/issues/4364
      ##
      #Header unset Cache-Control
      #Header append Cache-Control must-revalidate
    
      ##
      # Do not cache the cron.txt file
      # @see https://github.com/contao/core/issues/5105
      ##
      <FilesMatch "cron\.txt$">
        Header set Cache-Control "no-cache, no-store, must-revalidate, max-age=0, proxy-revalidate, no-transform"
      </FilesMatch>
    
      ##
      # Add a Vary Accept-Encoding header for the compressed resources. If you
      # modify the file types above, make sure to change them here accordingly.
      # @see http://developer.yahoo.com/performance/rules.html#gzip
      #
      # Note: If you are using a case-sensitive file system like HFS+ or ext4, you
      # have to change the <FilesMatch> directive as follows:
      #
      # <FilesMatch "\.(?i:js|css|xml|gz|svgz)$">
      #
      # For more information see: https://github.com/contao/core/issues/4364
      ##
      <FilesMatch "\.(js|css|xml|gz|svgz)$">
        Header append Vary Accept-Encoding
      </FilesMatch>
    
    </IfModule>
    # Deflate Compression by FileType
    #	<IfModule mod_deflate.c>
    #	 AddOutputFilterByType DEFLATE text/plain
    #	 AddOutputFilterByType DEFLATE text/html
    #	 AddOutputFilterByType DEFLATE text/xml
    #	 AddOutputFilterByType DEFLATE text/css
    #	 AddOutputFilterByType DEFLATE text/javascript
    #	 AddOutputFilterByType DEFLATE application/xml
    #	 AddOutputFilterByType DEFLATE application/xhtml+xml
    #	 AddOutputFilterByType DEFLATE application/rss+xml
    #	 AddOutputFilterByType DEFLATE application/atom_xml
    #	 AddOutputFilterByType DEFLATE application/javascript
    #	 AddOutputFilterByType DEFLATE application/x-javascript
    #	 AddOutputFilterByType DEFLATE application/x-shockwave-flash
    #</IfModule>
    
    
    ##
    # Disable MultiViews if you are having issues with requests returning the wrong
    # page. Requires AllowOverride Options=All,MultiViews to be set here.
    # @see https://github.com/contao/core/issues/3521
    ##
    #Options -MultiViews
    
    ##
    # URL rewriting
    ##
    <IfModule mod_rewrite.c>
      RewriteEngine On
    
      ##
      # Change the RewriteBase if your Contao installation is in a subdirectoy and
      # the rewrite rules are not working properly. Usage examples:
      #
      #   RewriteBase /contao-3.0.0
      #   RewriteBase /path/to/contao
      #
      # Depending on your server, you might have to remove the line entirely.
      ##
      RewriteBase /
    
    
      ##
      # Uncomment the following lines to add "www." to the domain:
      #
       #  RewriteCond %{HTTP_HOST} ^hauptdomain\.de$ [NC]
       #  RewriteRule (.*) http://www.hauptdomain.de/$1 [R=301,L]
      #
      # Uncomment the following lines to remove "www." from the domain:
      #
         RewriteCond %{HTTP_HOST} ^www\.hauptdomain\.de$ [NC]
         RewriteRule (.*) http://hauptdomain.de/$1 [R=301,L]
      #
      # Make sure to replace "example.com" with your domain name.
      ##
    
      ##
      # If you cannot use mod_deflate, uncomment the following lines to load a
      # compressed .gz version of the aggregated Contao JavaScript and CSS files.
      ##
      #AddEncoding gzip .gz
       #<FilesMatch "\.js\.gz$">
       # AddType "application/javascript" .gz
       #</FilesMatch>
       #<FilesMatch "\.css\.gz$">
       #AddType "text/css" .gz
       #</FilesMatch>
       #RewriteCond %{HTTP:Accept-encoding} gzip
       #RewriteCond %{REQUEST_FILENAME} \.(js|css)$
       #RewriteCond %{REQUEST_FILENAME}.gz -f
       #RewriteRule ^(.*)$ $1.gz [QSA,L]
    
      ##
      # By default, Contao adds ".html" to the generated URLs to simulate static
      # HTML documents. If you change the URL suffix in the back end settings, make
      # sure to change it here accordingly!
      #
    
      #  RewriteRule .*\.html$ index.php [L]   # URL suffix .html
      #  RewriteRule .*\.txt$ index.php [L]    # URL suffix .txt
      #  RewriteRule .*\.json$ index.php [L]   # URL suffix .json
      #
      # If you do not want to use an URL suffix at all, you have to add a third
      # line to prevent URLs that point to folders from being rewritten (see #4031).
      #
      #  RewriteCond %{REQUEST_FILENAME} !-d
      #  RewriteRule .* index.php [L]
      #
      # If you are using mod_cache, it is recommended to use the RewriteRule below,
      # which adds the query string to the internal URL:
      #
      #   RewriteRule (.*\.html)$ index.php/$1 [L]
      #
      # Note that not all environments support mod_rewrite and mod_cache.
      ##
      #	RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|otf|tt[cf]|woff2?|svgz?|pdf|gz)$
      # 	RewriteCond %{REQUEST_FILENAME} !-f
      # 	RewriteRule .*\.html$ index.php [L]
      
      ## Rewrite urls without suffix
      	RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|woff|svg|svgz|ttf|pdf|gz)$
      	RewriteCond %{REQUEST_FILENAME} !-f
      	RewriteCond %{REQUEST_FILENAME} !-d
      	RewriteRule .* index.php [L]
      ## End rewrite rule without suffix
    
      ##
      # The following rules are required if you want to pass the language as first
      # URL parameter (added in Contao 2.11). The first rule rewrites the empty URL
      # to the front end controller, the second one adds a missing trailing slash.
      ##
      RewriteRule ^[a-z]{2}(\-[A-Z]{2})?/$ index.php [L]
      RewriteRule ^([a-z]{2}(\-[A-Z]{2})?)$ $1/ [R=301,L]
    
    </IfModule>
    
    ##htttps redirects
    RewriteEngine On
    	RewriteCond %{SERVER_PORT} !^443$
    	RewriteRule (.*) https://%{HTTP_HOST}/$1 [R=301,L]
    	
    	##

  5. #5
    Contao-Nutzer
    Registriert seit
    20.08.2017.
    Beiträge
    28

    Standard

    Ich habe gerade festgestellt, dass nur die Hauptmenüpunkte davon betroffen sind. Also:

    • Seite 1
      • Seite 1-1
      • Seite 1-2
    • Seite 2
      • Seite 2-1
      • Seite 2-2


    Nur Seite 1 und Seite 2 sind über die Subdomain aufrufbar. Alle Untermenüpunkte nicht...

    EDIT: Und auch nur diese Seiten sind über die Subdomain 1 aufrufbar. Die Seiten der Hauptdomain, die keine Unterseite haben, sind ebenfalls nur über hauptdomain.de aufrufbar.
    Geändert von Christina17 (21.08.2017 um 10:04 Uhr)

  6. #6
    Contao-Urgestein Avatar von Samson1964
    Registriert seit
    05.11.2012.
    Ort
    Berlin
    Beiträge
    2.794

    Standard

    Zitat Zitat von Christina17 Beitrag anzeigen
    Ich habe gerade festgestellt, dass nur die Hauptmenüpunkte davon betroffen sind. Also:

    • Seite 1
      • Seite 1-1
      • Seite 1-2
    • Seite 2
      • Seite 2-1
      • Seite 2-2


    Nur Seite 1 und Seite 2 sind über die Subdomain aufrufbar. Alle Untermenüpunkte nicht...
    Das widerspricht sich jetzt mit #1, aber Du schreibst ja jetzt praktisch selbst, das Du das eigentlich nicht geprüft hast:
    Zitat Zitat von Christina17 Beitrag anzeigen
    Alle Seiten der Hauptdomain sind auch über die 1. Subdomain erreichbar, also subdomain1.hauptdomain.de/seite1
    Aber seite1 gibt es unter dem Seitenbaum der subdomain1 überhaupt nicht. Bei der 2. Subdomain tritt dieses Phänomen nicht auf.
    Aktuell sind also alle Seiten der Ebene 1 (direkt unterhalb der jeweiligen Startpunkte) über jede beliebige Subdomain erreichbar?! Alle weiteren Ebenen sind nicht betroffen?!

    Ich habe 6 Seitenstrukturen mit jeweiligen (Sub-)Domains in meiner 3.5.28. In der ersten Seitenstruktur gibt es die Seite spielbetrieb http://www.schachbund.de/spielbetrieb.html, in der zweiten Seitenstruktur gibt es die Seite spielbetrieb nicht, wie man sich anhand des 404 anschauen kann: http://senioren.schachbund.de/spielbetrieb.html. Bei mir ist also alles richtig. Ich habe auch genau diese Server (www.schachbund.de, senioren.schachbund.de) im Startpunkt drinzustehen.
    Viele Grüße
    Frank

    Seit Mai 2013 Fan von Contao
    Webmaster vom Deutschen Schachbund und Berliner Schachverband
    Mein Blog: Schachbulle
    Meine Erweiterungen bei GitHub
    Meine Videos auf YouTube: Playlist zur Contao-Programmierung/Einrichtung

  7. #7
    Contao-Nutzer
    Registriert seit
    20.08.2017.
    Beiträge
    28

    Standard

    Zitat Zitat von Samson1964 Beitrag anzeigen
    Das widerspricht sich jetzt mit #1, aber Du schreibst ja jetzt praktisch selbst, das Du das eigentlich nicht geprüft hast:


    Aktuell sind also alle Seiten der Ebene 1 (direkt unterhalb der jeweiligen Startpunkte) über jede beliebige Subdomain erreichbar?! Alle weiteren Ebenen sind nicht betroffen?!
    Ja, genau so ist es.

    Ich habe in den jeweiligen Startpunkten drin stehen:
    hauptdomain.de
    subdomain1.hauptdomain.de
    subdomain2.hauptdomain.de

    Und ich verwende auch Contao 3.5.28. Gibt es villeicht doch Möglichkeiten, dass im Template etwas nicht stimmt?

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

    Support Contao

    Standard

    Hmm, an der .htaccess fällt mir jetzt nichts auf, was die Änderung des Hostnamens auf die Hauptdomain erklären würde. Hast du schon mal mit den Entwicklertools geschaut, ob bei diesen Aufrufen über die Subdomain irgendwelche Weiterleitungen passieren?

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

    Support Contao

    Standard

    Auch wenn du es wahrscheinlich teilweise schon gemacht hast, checke nochmal folgende Punkte.

    • Fallbacksprache anhaken in jedem Startpunkt.
    • Der ersten Seite in jedem Startpunkt den Alias "index" geben.
    • Mal mit der originalen .htaccess(.default) probieren. Die Weiterleitungen www und HTTPS betreffend kann man fast immer auch im Hosting-Account setzen.
    • Originale Templates verwenden.
    • Im abgesichterten Modus probieren.
    • Contao-Check ausführen.
    Bitte!
    Vor Anfragen im Forum HTML validieren.
    Codesnippets hier im Froum sauber einrücken. Nur Tabs o. nur Leerzeichen verwenden.

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

  10. #10
    Contao-Nutzer
    Registriert seit
    20.08.2017.
    Beiträge
    28

    Standard

    Ich konnte jetzt ausmachen, dass es an diesem Abschnitt in der .htaccess liegt:
    Code:
      ## Rewrite urls without suffix
      	RewriteCond %{REQUEST_FILENAME} !\.(htm|php|js|css|htc|png|gif|jpe?g|ico|xml|csv|txt|swf|flv|mp4|webm|ogv|mp3|ogg|oga|eot|woff|svg|svgz|ttf|pdf|gz)$
      	RewriteCond %{REQUEST_FILENAME} !-f
      	RewriteCond %{REQUEST_FILENAME} !-d
      	RewriteRule .* index.php [L]
      ## End rewrite rule without suffix
    Welche andere Möglichkeit gibt es aber, das Suffix aus der url zu entfernen ohne dabei dieses Problem zu verursachen?

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
  •