Neuigkeiten
  • Die modified eCommerce Shopsoftware ist kostenlos, aber nicht umsonst.
    Spenden
  • Damit wir die modified eCommerce Shopsoftware auch zukünftig kostenlos anbieten können:
    Spenden
  • Thema: .htaccess duplicate content

    Trucker05

    • Schreiberling
    • Beiträge: 347
    .htaccess duplicate content
    am: 03. Mai 2012, 21:32:38
    Hallo,

    habe gerade gesehen, dass unser Shop einmal mit www. und einmal ohne www. erreichbar ist.
    Ohne www. sind wir gut im google index, haben das glaub auch mal in den google Webmastertools so angegeben.

    1. Frage: Sollte beim Aufruf der www. nicht automatisch auf die ohne www, Domain umgeleitet werden?

    Hier die .htaccess:
    Code: PHP  [Auswählen]
    # $Id: .htaccess,v 1.5 2005/05/19 17:09:19 Administrator Exp $
    #
    # This is used with Apache WebServers
    #
    # For this to work, you must include the parameter 'Options' to
    # the AllowOverride configuration
    #
    # Example:
    #
    #<Directory "/usr/local/apache/htdocs">
    #   AllowOverride Options
    #</Directory>
    #
    # 'All' with also work. (This configuration is in the
    # apache/conf/httpd.conf file)
    # The following makes adjustments to the SSL protocol for Internet
    # Explorer browsers
    <IfModule mod_setenvif.c>
      <IfDefine SSL>
        SetEnvIf User-Agent ".*MSIE.*" \
                 nokeepalive ssl-unclean-shutdown \
                 downgrade-1.0 force-response-1.0
      </IfDefine>
    </IfModule>

    # Fix certain PHP values
    # (commented out by default to prevent errors occuring on certain
    # servers)
    #<IfModule mod_php4.c>
    #  php_value session.use_trans_sid 0
    #  php_value register_globals 1
    #</IfModule>

    #-- set expire header for image, pdf, js and css files for 30 days
    #<FilesMatch "\.(ico|pdf|jpg|jpeg|png|gif|js|css)$" >
    #  Header set Cache-Control "max-age=2592000, public"
    #</FilesMatch>

    #-- Turn off ETags in HTTP-header
    #FileETag None

    #-- Call time pass reference error ?!
    #php_flag  allow_call_time_pass_reference On

    #-- XTC Session only on first visit
    #php_flag session.use_trans_sid 0

    #-----------------------------------------
    #- SEO Hartmut König
    #-----------------------------------------
    #-- ! Comment this line, if you get an ERROR 500 !
    #Options +FollowSymlinks

    # http://httpd.apache.org/docs/misc/rewriteguide.html
    RewriteEngine on


    #-- Sitemap
    RewriteRule ^sitemap(.*)\.html$ /shop_content.php?coID=8 [qsappend,L]

    ##-- Kategorien
    RewriteCond %{REQUEST_URI} (.*):::([_0-9]+):([_0-9]+)\.html$
    RewriteRule (.*):::([_0-9]+):([_0-9]+)\.html$ /index.php?cPath=$2&page=$3 [qsappend,L]
    RewriteCond %{REQUEST_URI} (.*):::([_0-9]+)\.html$
    RewriteRule (.*):::([_0-9]+)\.html$ /index.php?cPath=$2 [qsappend,L]

    ##-- Produkte
    RewriteRule (.*)::(.+)\.html$ /product_info.php?products_id=$2 [qsappend,L]

    ##-- Content
    RewriteRule (.*):_:([0-9]+)\.html$ /shop_content.php?coID=$2 [qsappend,L]

    ##-- Manufacturers
    RewriteCond %{REQUEST_URI} (.*):.:([_0-9]+):([_0-9]+)\.html$
    RewriteRule (.*):.:([_0-9]+):([_0-9]+)\.html$ /index.php?manufacturers_id=$2&page=$3 [qsappend,L]
    RewriteCond %{REQUEST_URI} (.*):.:([_0-9]+)\.html$
    RewriteRule (.*):.:([0-9]+)\.html$ /index.php?manufacturers_id=$2 [qsappend,L]

    ##-- Fehlerseiten auf die Sitemap lotsen
    ErrorDocument 400 /sitemap.html?error=400
    ErrorDocument 401 /sitemap.html?error=401
    ErrorDocument 402 /sitemap.html?error=402
    ErrorDocument 403 /sitemap.html?error=403
    ErrorDocument 404 /sitemap.html?error=404
    ErrorDocument 500 /sitemap.html?error=500

    ##-- BOF - Tomcraft - 2009-09-09 - Use canonical URLs
    # (don't use if your shop runs on a subdomain!)
    #
    #RewriteCond %{HTTP_HOST} !^www\. [NC]
    #RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
    #
    ##-- EOF - Tomcraft - 2009-09-09 - Use canonical URLs
    # BEGIN WordPress

    # END WordPress

    <IfModule mod_deflate.c>
            <FilesMatch "\.(css|js|x?html?|php)$">
               SetOutputFilter DEFLATE
            </FilesMatch>
      </IfModule>
           
        <IfModule mod_expires.c>
          ExpiresActive On
          ExpiresDefault "access plus 1 minutes"
          ExpiresByType text/html "access plus 1 minutes"
          ExpiresByType text/css "access plus 604800 seconds"
          ExpiresByType text/javascript "aaccess plus 604800 seconds"
          ExpiresByType text/plain "access plus 604800 seconds"
          ExpiresByType application/javascript "access plus 604800 seconds"
          ExpiresByType application/x-javascript "access plus 604800 seconds"
          ExpiresByType application/x-shockwave-flash "access plus 604800 seconds"
          ExpiresByType image/gif "access plus 604800 seconds"
          ExpiresByType image/jpeg "access plus 604800 seconds"
          ExpiresByType image/jpg "access plus 604800 seconds"
          ExpiresByType image/png "access plus 604800 seconds"
          ExpiresByType image/x-icon "access plus 604800 seconds"
          ExpiresByType image/ico "access plus 604800 seconds"
          ExpiresByType application/xhtml+xml "access plus 600 seconds"
          <FilesMatch ".*\.mhtml$">
            ExpiresActive Off
          </FilesMatch>
        </IfModule>
         
        #Turn ETagging off
       FileETag none
         
     

    2. Frage: Kann man das jetzt nochmals komplett auf www. ändern, ohne das man seine gute Position bei google verliert?

    Linkback: https://www.modified-shop.org/forum/index.php?topic=19841.0
    Trade Republic - Provisionsfrei Aktien handeln

    Matt

    • Experte
    • Beiträge: 4.241
    Re: .htaccess duplicate content
    Antwort #1 am: 03. Mai 2012, 21:53:07
    1. Frage: Sollte beim Aufruf der www. nicht automatisch auf die ohne www, Domain umgeleitet werden?

    Nein. In der .htaccess ist Code, der auf www. umleitet. Dieser ist aber kommentiert.

    2. Frage: Kann man das jetzt nochmals komplett auf www. ändern, ohne das man seine gute Position bei google verliert?

    Jein. Du wirst kurzfristig deine Rankings teilweise verlieren. Wenn alles sauber mit 301 umgeleitet wird werden die sich aber anschließend wieder stabilisieren.

    Trucker05

    • Schreiberling
    • Beiträge: 347
    Re: .htaccess duplicate content
    Antwort #2 am: 03. Mai 2012, 21:56:04
    Das heißt, es ist soweit alles richtig und wenn es mich nicht weiter stört, dass kein www. vorne dran ist, kann ich alles so lassen?

    Matt

    • Experte
    • Beiträge: 4.241
    Re: .htaccess duplicate content
    Antwort #3 am: 03. Mai 2012, 21:58:36

    guensi

    • Viel Schreiber
    • Beiträge: 2.288
    Re: .htaccess duplicate content
    Antwort #4 am: 03. Mai 2012, 22:01:01
    habe gerade gesehen, dass unser Shop einmal mit www. und einmal ohne www. erreichbar ist.
    Ohne www. sind wir gut im google index, haben das glaub auch mal in den google Webmastertools so angegeben.
    1. Frage: Sollte beim Aufruf der www. nicht automatisch auf die ohne www, Domain umgeleitet werden?

    Nein, denn die canonical URL ist noch ausgeblendet, so funktioniert das mit nur www.:
    Code: PHP  [Auswählen]
    # $Id: .htaccess,v 1.5 2005/05/19 17:09:19 Administrator Exp $

    ##-- BOF - Tomcraft - 2009-09-09 - Use canonical URLs
    # (don't use if your shop runs on a subdomain!)
    #
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
    #
    ##-- EOF - Tomcraft - 2009-09-09 - Use canonical URLs

     
    und so sollte das nur ohne www funktionieren (nicht getestet):
    Code: PHP  [Auswählen]
    # $Id: .htaccess,v 1.5 2005/05/19 17:09:19 Administrator Exp $

    ##-- BOF - Tomcraft - 2009-09-09 - Use canonical URLs
    # (don't use if your shop runs on a subdomain!)
    #
    RewriteCond %{HTTP_HOST} ^www\. [NC]
    RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
    #
    ##-- EOF - Tomcraft - 2009-09-09 - Use canonical URLs

     

    Trucker05

    • Schreiberling
    • Beiträge: 347
    Re: .htaccess duplicate content
    Antwort #5 am: 03. Mai 2012, 22:08:55
    Code: PHP  [Auswählen]
        # $Id: .htaccess,v 1.5 2005/05/19 17:09:19 Administrator Exp $
       
        ##-- BOF - Tomcraft - 2009-09-09 - Use canonical URLs
       # (don't use if your shop runs on a subdomain!)
       #
       RewriteCond %{HTTP_HOST} ^www\. [NC]
        RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1 [L,R=301]
        #
       ##-- EOF - Tomcraft - 2009-09-09 - Use canonical URLs
       
         

    Deine Lösung ohne www. bringt einen Umleitungsfehler?

    Matt

    • Experte
    • Beiträge: 4.241
    Re: .htaccess duplicate content
    Antwort #6 am: 03. Mai 2012, 22:12:35
    Deshalb schrieb er ja 'nicht getestet'.

    RewriteCond %{HTTP_HOST} !^example\.com$
    RewriteRule ^(.*)$ http://example.com/$1 [L,R=301]

    Trucker05

    • Schreiberling
    • Beiträge: 347
    Re: .htaccess duplicate content
    Antwort #7 am: 03. Mai 2012, 22:21:12
    Deshalb schrieb er ja 'nicht getestet'.


    Hab ich schon gesehen  ;-)
    Matt, mit Deiner Lösung geht´s! Danke

    Vielleicht war das ja der Grund, dass ich mit meinem wichtigsten Keyword immer nur auf Platz drei bei google bleib  :-? Und das schon seit zwei Jahren.....

    ...mal schauen

    guensi

    • Viel Schreiber
    • Beiträge: 2.288
    Re: .htaccess duplicate content
    Antwort #8 am: 03. Mai 2012, 22:23:42
    OOPS, krasser Denkfehler, danke fürs Korrigieren Matt.  :paperbag:

    elpego

    • Schreiberling
    • Beiträge: 337
    • Geschlecht:
    Re: .htaccess duplicate content
    Antwort #9 am: 13. Mai 2012, 14:15:59
    hallo matt,
    muß ich die Garten Latten # entfernen damit die Umleitung aktiviert wird?

    #
    RewriteCond %{HTTP_HOST} !^www\. [NC]
    RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [L,R=301]
    #

    Denke doch, aber bevor ich was falsch mache frage ich lieber.
    Ein kurze Ja oder Nein reicht.

    Gruß Peter

    jannemann

    • modified Team
    • Beiträge: 6.275
    • Geschlecht:
    AW: .htaccess duplicate content
    Antwort #10 am: 13. Mai 2012, 16:11:38
    Ja

    elpego

    • Schreiberling
    • Beiträge: 337
    • Geschlecht:
    Re: .htaccess duplicate content
    Antwort #11 am: 13. Mai 2012, 17:21:57
    hallo jannemann,
    Danke Dir.

    Gruß Peter

    web0null

    • Experte
    • Beiträge: 1.998
    Re: .htaccess duplicate content
    Antwort #12 am: 14. Mai 2012, 16:55:49
    Hi jannemann,

    Eigentlich musste er sie nicht entfernen, aus den genannten gründen:
    Zitat
    muß ich die Garten Latten # entfernen damit die Umleitung aktiviert wird?

    Die Umleitung war ja nicht auskommentiert, die zwei Raute Zeichen waren nur unnötig.
    will aber nicht  Klug...... :-D  :-X

    Gruß web0null
    rechtstexte für onlineshop
    5 Antworten
    4911 Aufrufe
    19. Juni 2012, 09:56:35 von Van
    6 Antworten
    4105 Aufrufe
    06. August 2012, 19:44:26 von macca
    3 Antworten
    4321 Aufrufe
    16. August 2012, 23:15:39 von Guenter59
    6 Antworten
    5034 Aufrufe
    18. Februar 2015, 13:41:36 von timopaul
               
    anything