Ankündigung

Einklappen
Keine Ankündigung bisher.

htaccess redirect einrichten - wo?

Einklappen
X
 
  • Filter
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge

    htaccess redirect einrichten - wo?

    Hallo,

    für unsere SEO Optimierung möchten wir ein Redirect sowie Browser Caching einrichten.
    Dazu muss die .htaccess bearbeitet werden. Jedoch kann ich die Datei nirgendwo finden bzw. liegen mehrere htaccess Dateien
    auf dem Server. Einige Versuche im Ordner /includes/.htacces sowie im Ordner /extras/ sind erfolglos. Wo finde ich die richtige htaccess?

    Für Tipps wäre ich sehr dankbar.

    #2
    Eine solche .htaccess gehört ins Shopverzeichnis, nicht in irgendeinen Unterordner. Wenn dort noch keine ist, eben eine anlegen.

    Kommentar


      #3
      htaccess redirect einrichten - wo?

      Hallo Webchills,

      ich habe eine htaccess im Shopverzeichnis angelegt. Daraufhin erscheint ein Error im Shop.
      Wie kann das sein?

      Kommentar


        #4
        Ohne genauere Angaben ist es unmöglich, dazu etwas Sinnvolles zu sagen.

        Welcher Error erscheint?
        Was genau ist der Inhalt dieser .htaccess?

        Beachte auch, dass eine .htaccess im FTP Programm im Ascii Modus hochgeladen werden muss.

        Kommentar


          #5
          htaccess redirect einrichten - wo?

          Es erscheint der Fehler 404 Forbidden...


          In der htaccess steht:

          # deny *everything*
          <FilesMatch ".*">
          Order Allow,Deny
          Deny from all
          </FilesMatch>

          # but now allow just *certain* necessary files:
          <FilesMatch ".*\.(js|JS|css|CSS|jpg|JPG|gif|GIF|png|PNG|swf|SW F|xsl|XSL)$">
          Order Allow,Deny
          Allow from all
          </FilesMatch>

          IndexIgnore */*


          ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
          # OPTIONS -Indexes -ExecCGI

          ##Weiterleitungen
          ErrorDocument 410 /catalog/gone.html
          ....


          Das FTP Programm ist unter Automatisch eingestelt (ASCII & Binär)
          Zuletzt geändert von Merena; 23.04.2015, 11:57.

          Kommentar


            #6
            Was Du hier postest ist zumindest im oberen Teil der Inhalt der .htaccess im includes Verzeichnis, die hat im Shophauptverzeichnis nichts verloren.

            Was soll das hier bringen?
            Code:
            ErrorDocument 410 /catalog/gone.html
            Schaut aus wie aus irgendeinem Beispiel reinkopiert.

            Daher nochmal:
            Welchen Code genau willst Du warum genau in die .htaccess einfügen?
            Was soll damit erreicht werden?

            Kommentar


              #7
              htaccess redirect einrichten - wo?

              Ich möchte in der htaccess Weiterleitungen einfügen. Die habe ich hier jetzt nicht aufgeführt sondern das Beispiel.
              So habe ich die Weiterleitungen eingebaut:

              Redirect Gone / index.php?main_page...

              Ausserdem soll das Browser Caching hinterlegt werden.

              #Browser Caching
              <IfModule mod_expires.c>
              ExpiresActive On
              ExpiresByType text/css "access plus 1 week"
              ExpiresByType text/javascript "access plus 1 week"
              ExpiresByType text/html "access plus 1 week"
              ExpiresByType application/javascript "access plus 1 month"
              ExpiresByType application/x-javascript "access plus 1 month"
              ExpiresByType image/gif "access plus 1 month"
              ExpiresByType image/jpeg "access plus 1 month"
              ExpiresByType image/png "access plus 1 month"
              ExpiresByType image/x-icon "access plus 1 month"
              </IfModule>

              Kommentar


                #8
                Browsercaching und Redirects sind 2 Paar Schuhe.

                Für das Browsercaching ist die .htaccess im includes Verzeichnis zuständig, hier ist das seit Zen Cart 1.5.3 bereits aktiv,
                Um das auch im alten 1.5 zu verwenden, kannst Du die includes/.htaccess aus 1.5.3 verwenden, die folgenden Inhalt hat:
                Code:
                #
                # @copyright Copyright 2003-2014 Zen Cart Development Team
                # @license http://www.zen-cart-pro.at/license/2_0.txt GNU Public License V2.0
                # @version $Id: .htaccess 837 2014-02-08 20:33:58Z webchills $
                #
                # This is used with Apache WebServers
                #
                # The following blocks direct HTTP requests to all filetypes in this directory recursively, except certain approved exceptions
                # It also prevents the ability of any scripts to run. No type of script, be it PHP, PERL or whatever, can normally be executed if ExecCGI is disabled.
                # Will also prevent people from seeing what is in the dir. and any sub-directories
                #
                # For this to work, you must include either 'All' or at least: 'Limit' and 'Indexes' parameters to the AllowOverride configuration in your apache/conf/httpd.conf file.
                # Additionally, if you want the added protection offered by the OPTIONS directive below, you'll need to add 'Options' to the AllowOverride list, if 'All' is not specified. 
                # Example:
                #<Directory "/usr/local/apache/htdocs">
                #  AllowOverride Limit Options Indexes
                #</Directory>
                ###############################
                
                # deny *everything*
                <FilesMatch ".*">
                  Order Allow,Deny
                  Deny from all
                </FilesMatch>
                
                # but now allow just *certain* necessary files:
                <FilesMatch "(?i).*\.(js|css|html?|ico|jpe?g|gif|webp|png|swf|flv|xml|xsl|otf|ttf|woff|eot|svg)$">
                  Order Allow,Deny
                  Allow from all
                </FilesMatch>
                
                IndexIgnore */*
                
                <limit POST PUT>
                order deny,allow
                deny from All
                </limit>
                
                
                ## NOTE: If you want even greater security to prevent hackers from running scripts in this folder, uncomment the following line (if your hosting company will allow you to use OPTIONS):
                # OPTIONS -Indexes -ExecCGI
                
                
                
                ##################
                ## Optional caching improvements
                ## Requires mod_header and mod_deflate to be enabled within Apache
                ##################
                <IfModule mod_headers.c>
                  Header unset Pragma
                  FileETag None
                  Header unset ETag
                  #Header set Cache-Control "no-transform"
                  <FilesMatch "(?i).*\.(ico|jpe?g|gif|webp|png|otf|swf|flv|ttf|woff|eot|svg)$">
                    Header set Cache-control "max-age=864000, public, must-revalidate"
                    Header unset Last-Modified
                  </FilesMatch>
                  <FilesMatch "(?i).*\.(html|htm|xml|txt|xsl)$">
                    Header set Cache-control "max-age=7200, must-revalidate"
                  </FilesMatch>
                </IfModule>
                <IfModule mod_deflate.c>
                  <FilesMatch "(?i)\.(js|css)$">
                    SetOutputFilter DEFLATE
                  </FilesMatch>
                </IfModule>
                
                ##################
                ## Optional improvements
                ## Requires mod_expires to be enabled within Apache
                ##################
                <ifmodule mod_expires.c>
                  ExpiresActive On
                  ExpiresDefault A300
                  ExpiresByType application/x-javascript A3600
                  ExpiresByType text/css A3600
                  ExpiresByType image/gif A604800
                  ExpiresByType video/x-flv A604800
                  ExpiresByType application/pdf A604800
                  ExpiresByType text/html A300
                  ExpiresByType image/x-icon A86400
                  ExpiresByType image/jpeg A2592000
                  ExpiresByType image/png A2592000
                </ifmodule>
                Für Redirects immer nur die .htaccess im Shophauptverzeichnis verwenden. Da das sehr individuell ist, ist es wie gesagt unmöglich, dazu was zu sagen, ohne die genauen Redirects zu kennen.

                Kommentar


                  #9
                  htaccess redirect einrichten - wo?

                  Super, vielen Dank für die Infos und die schnelle Hilfe. Ich werde es so wie du geschrieben hast einmal ausprobieren.
                  Gruß Merena

                  Kommentar


                    #10
                    htaccess redirect einrichten

                    Hallo,

                    ich habe die Redirects nach der Anleitung in die htaccess eingetragen.
                    Es funktioniert soweit auch. Zumindest die Redirects für die 404 und 410 Seite.

                    ErrorDocument 404 / shop/page_not_found.php
                    ErrorDocument 410 / shop/page_not_found.php

                    Danach folgen die Links mit Artikeln die es nicht mehr gibt. Diese wiederrum greifen leider nicht.

                    Redirect gone /shop/index.php?main_page=product_info&cPath=0&products_ id=XXXX

                    Ich habe das Problem mit unserem Provider/Hoster besprochen der mir sagte, dass es nicht am Server liegt, sondern an Zen Cart.
                    Hat jemand eine Idee wo das Problem liegt oder ob man das anders lösen kann?

                    Kommentar


                      #11
                      htaccess redirect einrichten

                      Hat niemand eine Idee???

                      Kommentar


                        #12
                        Ohne den exakten Inhalt der .htaccess zu kennen, ist es unmöglich dazu etwas Sinnvolles zu sagen.

                        Kommentar


                          #13
                          htaccess redirect einrichten

                          Das ist der Inhalt der htaccess im root Verzeichnis.

                          ##Weiterleitungen
                          ErrorDocument 404 /catalog/page_not_found.php
                          ErrorDocument 410 /catalog/page_not_found.php
                          #Redirect gone http://www.Domain.de/catalog/123
                          #Redirect Domain.de/ http://www.Domain.de/catalog

                          Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13438
                          Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13439
                          Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13477

                          Als Lösung dachte ich würde es auch so funktionieren:

                          RewriteEngine On
                          RewriteCond %{QUERY_STRING} main_page=product_info&cPath=0&products_id=[13529,13726,99999] [NC]
                          RewriteRule ^ - [L,G=410]

                          Gruß
                          Merena

                          Kommentar


                            #14
                            htaccess redirect einrichten - wo?
                            Das ist der Inhalt der htaccess im root Verzeichnis.

                            ##Weiterleitungen
                            ErrorDocument 404 /catalog/page_not_found.php
                            ErrorDocument 410 /catalog/page_not_found.php
                            #Redirect gone http://www.Domain.de/catalog/123
                            #Redirect Domain.de/ http://www.Domain.de/catalog

                            Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13438
                            Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13439
                            Redirect gone /catalog/index.php?main_page=product_info&cPath=0&products_ id=13477

                            Als Lösung dachte ich würde es auch so funktionieren:

                            RewriteEngine On
                            RewriteCond %{QUERY_STRING} main_page=product_info&cPath=0&products_id=[13529,13726,99999] [NC]
                            RewriteRule ^ - [L,G=410]

                            Gruß
                            Merena

                            Kommentar


                              #15
                              Ich weiß nach wie vor nicht, was Du genau machen willst, Du verrätst es auch nicht, aber wenn Du z.B. aus irgendeinem Grund die Artikel mit den IDs 34,12,27 und 26 auf irgendeine andere Seite weiterleiten willst, dann wäre das so möglich:
                              Code:
                              RewriteEngine On
                              RewriteCond %{QUERY_STRING} ^main_page=product_info&cPath=([0-9]+)&products_id=(34|12|27|26)$ [NC]
                              RewriteRule ^(index\.php)?$ http://www.neueadresse.org/irgendwas/? [R=301,L]

                              Kommentar

                              Info zu diesem Forenarchiv:
                              Mit Release von 1.5.7 wurde die deutsche Zen Cart Version auf eine reine DIY-Lösung umgestellt.
                              Für einen Support via Forum stehen keine personellen und zeitlichen Ressourcen mehr zur Verfügung.
                              Dieses Supportforum bleibt im Nur-Lesen-Modus als Wissensarchiv noch online verfügbar.
                              PM Funktionalität, Registrierung und Posten neuer Beiträge sind deaktiviert.
                              Zugriff auf Anhänge in den Postings ist auch ohne Registrierung/Einloggen möglich.
                              FAQ und Downloadbereich des Forums wurden in die neue umfangreiche Knowledgebase auf der zen-cart-pro.at Website übernommen.

                              Das Development der deutschen Zen Cart Version geht wie bisher auf Github weiter.
                              Wir werden auch weiterhin neue Versionen bereitstellen und die Onlinedokumentation/Knowledgebase aktualisieren.
                              Fehler in der Software können auf Github als Issues gemeldet werden.
                              Follow us
                              aktuelle version
                              Zen Cart 1.5.7g deutsch
                              vom 12.12.2023
                              [Download]
                              Lädt...
                              X