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: 301 redirect von /shop zu root

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    301 redirect von /shop zu root
    am: 31. August 2012, 10:55:04
    Hallo,

    ich habe mich durch sämtliche 301 beiträge gelesen, aber ich bekomme es nicht wirklich hin.

    Der alte Shop liegt mittlerweile in /shop_alt (ist ein xtc304) xtc modified läuft im root Verzeichnis (hatte ach schon probiert in /shop zu schieben, brachte aber auch nichts).

    Die alten Links sahen so aus:
    http://www.meinedomain.de/shop/index.php?cat=c140_Kategoriename.html

    Die neuen so:
    http://www.meinedomain.de/Kategoriename:::140.html

    Was genau muss ich in der htaccess einstellen und soll auch eine in den alten /shop order?
    Habe schon alle möglichen Varianten durch, aber bekomme nur 404 seiten hin.

    Grüße Harry

    Linkback: https://www.modified-shop.org/forum/index.php?topic=22056.0

    Alfred

    • Experte
    • Beiträge: 2.115
    Re: 301 redirect von /shop zu root
    Antwort #1 am: 31. August 2012, 11:11:14
    Hallo,

    es gibt die verschiedensten Wege für die 301-Weiterleitungen.

    Wenn du nur von /shop auf / willst geht das z.B. so:

    Zitat
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^shop(.*) $1 [R=301,L]

    Gruß

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    Re: 301 redirect von /shop zu root
    Antwort #2 am: 31. August 2012, 11:50:06
    Hallo Alfred,

    nicht nur, sondern die alten URLS sollen in die neuen Shopstat URLs umgeschrieben werden, dass soll bei Modified doch schon eingebaut sein und die mitgelieferte htaccess sieht auch danach aus.

    Dein Vorschlag habe ich einmal in die mitgelieferte Datei eingebaut und einmal habe ich das ganze in eine eigene Datei im /shop Ordner geschrieben, beides brachte nur

    Zitat
    Error 500 Internal Server Error
    The server encountered an internal error or misconfiguration and was unable to complete your request.

    Das ganze kann doch nur eine kleine Angabe in der mitgelieferten htaccess Datei sein, anstatt sie 1:1 von der alten Schreibweise in die neue Umzuschreiben muss noch der Hinweis rein, dass die /shop jetzt root ist.

    Ich habe gestern schon die ganze Nacht damit verbracht, aber ich komme nicht drauf  :datz:

    Alfred

    • Experte
    • Beiträge: 2.115
    Re: 301 redirect von /shop zu root
    Antwort #3 am: 31. August 2012, 11:52:27
    Hallo,

    dann hast du das an der falschen Stelle eingebaut.

    Gruß

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    Re: 301 redirect von /shop zu root
    Antwort #4 am: 31. August 2012, 12:14:10
    Hm, am besten ich poste mal was ich gemacht habe, ich gebe zu ich war auch nicht ganz sicher wo es hin muss.

    Also, 1. Versuch .htaccess Datei im Root, dein Befehl integriert unter Rewite Engine On

    ##-- $Id: _.htaccess 2670 2012-02-23 12:53:47Z dokuman $

    ##-- Default charset
    #AddDefaultCharset utf-8
    AddDefaultCharset ISO-8859-15

    ##-- Disable the server signature
    ServerSignature Off

    ##-- Turn off ETags in HTTP-header (use both directives)
    <IfModule mod_headers.c>
      Header unset ETag
    </IfModule>
    FileETag None

    ##-- When caching of gzipped JS and CSS files is used, enable this setting
    #<IfModule mod_headers.c>
    #  Header set Vary Accept-Encoding
    #</IfModule>

    ## Hoster 1&1 (activate PHP5)
    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

    # Disable directory browsing
    Options All -Indexes

    ##-- Enable the compression for any type of content
    #<IfModule mod_deflate.c>
    #  <FilesMatch "\\.(js|css|html|htm|php|xml|jpg|jpeg|png|gif)$">
    #    SetOutputFilter DEFLATE
    #  </FilesMatch>
    #</IfModule>

    ##-- Customization of HTTP request and response headers
    <IfModule mod_headers.c>
      <FilesMatch "\\.(ico|jpe?g|png|gif|swf|flv)$">
        Header set Cache-Control "max-age=2592000, public"
      </FilesMatch>
      <FilesMatch "\\.(css)$">
        Header set Cache-Control "max-age=604800, public"
      </FilesMatch>
      <FilesMatch "\\.(js)$">
        Header set Cache-Control "max-age=216000, private"
      </FilesMatch>
      <FilesMatch "\\.(xml|txt)$">
        Header set Cache-Control "max-age=216000, public, must-revalidate"
      </FilesMatch>
      <FilesMatch "\\.(html|htm|php)$">
        Header set Cache-Control "max-age=1, private, must-revalidate"
      </FilesMatch>
    </IfModule>

    ##-- Generation of Expires and Cache-Control HTTP headers
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 1 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 216000 seconds"
      ExpiresByType application/x-javascript "access plus 216000 seconds"
    </IfModule>

    ##-- Configure php_flags if necessary
    ##-- use IfModule clause if PHP runs in CGI mode, otherwise just uncomment the lines with php_flag...
    #<IfModule mod_php.c>
      ##-- Warn when arguments are passed by reference at function call time (from PHP5 allow_call_time_pass_reference is deprecated)
      #php_flag allow_call_time_pass_reference on
      ##-- Disable transparent sid support PHP-default is off (XTC Session only on first visit)
      #php_flag session.use_trans_sid off
      ##-- set suhosin flags because of errors with attributes (for webhosters with suhosin hardening patch enabled)
      #php_value suhosin.post.max_array_depth 0
      #php_value suhosin.post.max_array_index_length 0
      #php_value suhosin.post.max_vars 0
      #php_value suhosin.request.max_array_depth 0
      #php_value suhosin.request.max_array_index_length 0
      #php_value suhosin.request.max_vars 0
      ##-- set suhosin flags to have unencrypted session data, affecting "whos_online" & "shopping cart" (for webhosters with suhosin hardening patch enabled)patch enabled
      #php_value suhosin.session.encrypt Off
      #php_value suhosin.session.cryptkey ''
    #</IfModule>

    ##-- when using Provider 1&1 set the following lines to activate PHP5
    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

    ##-- Redirect error pages to Sitemap
    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

    ##-----------------------------------------
    ##- SEO Shopstat Modul (Hartmut König)
    ##-----------------------------------------
    <IfModule mod_rewrite.c>
      ##-- Initialize and enable rewrite engine
      RewriteEngine On

      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^shop(.*) $1 [R=301,L]

      ##-- EXAMPLE: If your shop is located at "http://www.yourdomain.com/shop",
      ##-- set the following line like e.g.: RewriteBase /shop
      RewriteBase /


      ##-- Use canonical URLs
      ##-- redirect to www-domain, when www is missing and no subdomain given and not using an ssl-proxy
      RewriteCond %{HTTP:X-Forwarded-Server}   !^ssl\.webpack\.de$ [NC]
      RewriteCond %{HTTP:X-Forwarded-Server}   !^sslsites\.de$ [NC]
      RewriteCond %{HTTP_HOST}                 !^www\..* [NC]
      RewriteCond %{HTTP_HOST}                 !^.*\..*\..* [NC]
      RewriteCond %{HTTP_HOST}                 !^localhost(.*)$ [NC]
      RewriteCond %{REMOTE_ADDR}               !127.0.0.1$ [NC]
      RewriteRule ^(.*)                        http://www.%{HTTP_HOST}/$1 [R=301,L]
     
      #-- redirect /folder/index.php to /folder/ (i.e. hide index.php)
      RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
      RewriteRule ^index\.php$ http://%{HTTP_HOST}/ [R=301,L]

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

      ##----------------------------------------------------------------------------------
      ##-- When working with SEO-Urls you can decide, wheter to use a colon ":" or a dash "-" symbol
      ##-- (Windows Servers might have problems with colon as delimiter!)
      ##-- Change the delimiter symbol also in file "/inc/shopstat_functions.inc.php"
      ##----------------------------------------------------------------------------------

      ##-- Use colon delimiter ":" for SEO-URLS (default setting)
      ##-- Categories (:::)
      RewriteCond %{REQUEST_URI} (.*):::([_0-9]+):([_0-9]+)\.html$
      RewriteRule (.*):::([_0-9]+):([_0-9]+)\.html$ index.php?cPath=$2&page=$3 [QSA,L]
      RewriteCond %{REQUEST_URI} (.*):::([_0-9]+)\.html$
      RewriteRule (.*):::([_0-9]+)\.html$ index.php?cPath=$2 [QSA,L]

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

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

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

      ##-- Use dash delimiter "-" for SEO-URLS
      ##-- Categories (---)
      #RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)-([_0-9]+)\.html$
      #RewriteRule (.*)---([_0-9]+)-([_0-9]+)\.html$ index.php?cPath=$2&page=$3 [QSA,L]
      #RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)\.html$
      #RewriteRule (.*)---([_0-9]+)\.html$ index.php?cPath=$2 [QSA,L]

      ##-- Products (--)
      #RewriteRule (.*)--(.+)\.html$ product_info.php?products_id=$2 [QSA,L]

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

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

    </IfModule>

    2. Versuch, orginale .htaccess im Shop Root ohne Änderung, deine Änderung in einer .htaccess im Ordner /shop ohne sonstige Angaben.

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^shop(.*) $1 [R=301,L]

    Der Fehler 500 ist immer noch da.

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    Re: 301 redirect von /shop zu root
    Antwort #5 am: 31. August 2012, 14:04:14
    Hallo,

    es gibt die verschiedensten Wege für die 301-Weiterleitungen.

    Wenn du nur von /shop auf / willst geht das z.B. so:

    Zitat
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ^shop(.*) $1 [R=301,L]

    Gruß

    Ok, habe es nun richtig eingebaut  :paperbag: allerdings wird jetzt aus:

    http://www.meinedomain.de/shop/index.php?cat=c140_Kategoriename.html

    das:
    http://www.meinedomain.de/index.php?cat=c140_Kategoriename.html

    Also /shop wir jetzt überall zu root, aber die Umwandlung der alten xtc304 Domains  zu Modified funktioniert nicht. Noch jemand einen Hinweis?

    Und erstmal vielen Dank Alfred!

    Alfred

    • Experte
    • Beiträge: 2.115
    Re: 301 redirect von /shop zu root
    Antwort #6 am: 31. August 2012, 16:42:31
    Ok, habe es nun richtig eingebaut  :paperbag: allerdings wird jetzt aus:

    http://www.meinedomain.de/shop/index.php?cat=c140_Kategoriename.html

    das:
    http://www.meinedomain.de/index.php?cat=c140_Kategoriename.html

    dann erweitere die .htaccess darunter mit

    Zitat
    RewriteCond %{QUERY_STRING} ^.*cat=c([0-9]*).*$
    RewriteRule ^.*$ /cPath=%1  [R=301,L]

    Gruß

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    Re: 301 redirect von /shop zu root
    Antwort #7 am: 31. August 2012, 17:46:20
    Keine Änderung, so sieht sie die Datei im Root gerade aus. Ich sehe mich schon das ganze Wochenende mit Strg-C Strg-V verbringen.

    Oder was gibt es noch zu beachten, ausser Server mit Mod Rewrite? Und bei /shop hat es ja geklappt, also liegt es nicht am Server.

    ##-- $Id: _.htaccess 2670 2012-02-23 12:53:47Z dokuman $

    ##-- Default charset
    #AddDefaultCharset utf-8
    AddDefaultCharset ISO-8859-15

    ##-- Disable the server signature
    ServerSignature Off

    ##-- Turn off ETags in HTTP-header (use both directives)
    <IfModule mod_headers.c>
      Header unset ETag
    </IfModule>
    FileETag None

    ##-- When caching of gzipped JS and CSS files is used, enable this setting
    #<IfModule mod_headers.c>
    #  Header set Vary Accept-Encoding
    #</IfModule>

    ## Hoster 1&1 (activate PHP5)
    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

    # Disable directory browsing
    Options All -Indexes

    ##-- Enable the compression for any type of content
    #<IfModule mod_deflate.c>
    #  <FilesMatch "\\.(js|css|html|htm|php|xml|jpg|jpeg|png|gif)$">
    #    SetOutputFilter DEFLATE
    #  </FilesMatch>
    #</IfModule>

    ##-- Customization of HTTP request and response headers
    <IfModule mod_headers.c>
      <FilesMatch "\\.(ico|jpe?g|png|gif|swf|flv)$">
        Header set Cache-Control "max-age=2592000, public"
      </FilesMatch>
      <FilesMatch "\\.(css)$">
        Header set Cache-Control "max-age=604800, public"
      </FilesMatch>
      <FilesMatch "\\.(js)$">
        Header set Cache-Control "max-age=216000, private"
      </FilesMatch>
      <FilesMatch "\\.(xml|txt)$">
        Header set Cache-Control "max-age=216000, public, must-revalidate"
      </FilesMatch>
      <FilesMatch "\\.(html|htm|php)$">
        Header set Cache-Control "max-age=1, private, must-revalidate"
      </FilesMatch>
    </IfModule>

    ##-- Generation of Expires and Cache-Control HTTP headers
    <IfModule mod_expires.c>
      ExpiresActive On
      ExpiresDefault "access plus 1 seconds"
      ExpiresByType image/gif "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 216000 seconds"
      ExpiresByType application/x-javascript "access plus 216000 seconds"
    </IfModule>

    ##-- Configure php_flags if necessary
    ##-- use IfModule clause if PHP runs in CGI mode, otherwise just uncomment the lines with php_flag...
    #<IfModule mod_php.c>
      ##-- Warn when arguments are passed by reference at function call time (from PHP5 allow_call_time_pass_reference is deprecated)
      #php_flag allow_call_time_pass_reference on
      ##-- Disable transparent sid support PHP-default is off (XTC Session only on first visit)
      #php_flag session.use_trans_sid off
      ##-- set suhosin flags because of errors with attributes (for webhosters with suhosin hardening patch enabled)
      #php_value suhosin.post.max_array_depth 0
      #php_value suhosin.post.max_array_index_length 0
      #php_value suhosin.post.max_vars 0
      #php_value suhosin.request.max_array_depth 0
      #php_value suhosin.request.max_array_index_length 0
      #php_value suhosin.request.max_vars 0
      ##-- set suhosin flags to have unencrypted session data, affecting "whos_online" & "shopping cart" (for webhosters with suhosin hardening patch enabled)patch enabled
      #php_value suhosin.session.encrypt Off
      #php_value suhosin.session.cryptkey ''
    #</IfModule>

    ##-- when using Provider 1&1 set the following lines to activate PHP5
    #AddType x-mapp-php5 .php
    #AddHandler x-mapp-php5 .php

    ##-- Redirect error pages to Sitemap
    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

    ##-----------------------------------------
    ##- SEO Shopstat Modul (Hartmut König)
    ##-----------------------------------------
    <IfModule mod_rewrite.c>
      ##-- Initialize and enable rewrite engine
      RewriteEngine On

      ##-- EXAMPLE: If your shop is located at "http://www.yourdomain.com/shop",
      ##-- set the following line like e.g.: RewriteBase /shop
      RewriteBase /

      ##-- Use canonical URLs
      ##-- redirect to www-domain, when www is missing and no subdomain given and not using an ssl-proxy
      RewriteCond %{HTTP:X-Forwarded-Server}   !^ssl\.webpack\.de$ [NC]
      RewriteCond %{HTTP:X-Forwarded-Server}   !^sslsites\.de$ [NC]
      RewriteCond %{HTTP_HOST}                 !^www\..* [NC]
      RewriteCond %{HTTP_HOST}                 !^.*\..*\..* [NC]
      RewriteCond %{HTTP_HOST}                 !^localhost(.*)$ [NC]
      RewriteCond %{REMOTE_ADDR}               !127.0.0.1$ [NC]
      RewriteRule ^(.*)                        http://www.%{HTTP_HOST}/$1 [R=301,L]
     
      RewriteCond %{REQUEST_FILENAME} !-f
      RewriteRule ^shop(.*) $1 [R=301,L]
     
      RewriteCond %{QUERY_STRING} ^.*cat=c([0-9]*).*$
      RewriteRule ^.*$ /cPath=%1  [R=301,L]
     
      #-- redirect /folder/index.php to /folder/ (i.e. hide index.php)
      RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
      RewriteRule ^index\.php$ http://%{HTTP_HOST}/ [R=301,L]

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

      ##----------------------------------------------------------------------------------
      ##-- When working with SEO-Urls you can decide, wheter to use a colon ":" or a dash "-" symbol
      ##-- (Windows Servers might have problems with colon as delimiter!)
      ##-- Change the delimiter symbol also in file "/inc/shopstat_functions.inc.php"
      ##----------------------------------------------------------------------------------

      ##-- Use colon delimiter ":" for SEO-URLS (default setting)
      ##-- Categories (:::)
      RewriteCond %{REQUEST_URI} (.*):::([_0-9]+):([_0-9]+)\.html$
      RewriteRule (.*):::([_0-9]+):([_0-9]+)\.html$ index.php?cPath=$2&page=$3 [QSA,L]
      RewriteCond %{REQUEST_URI} (.*):::([_0-9]+)\.html$
      RewriteRule (.*):::([_0-9]+)\.html$ index.php?cPath=$2 [QSA,L]

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

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

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

      ##-- Use dash delimiter "-" for SEO-URLS
      ##-- Categories (---)
      #RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)-([_0-9]+)\.html$
      #RewriteRule (.*)---([_0-9]+)-([_0-9]+)\.html$ index.php?cPath=$2&page=$3 [QSA,L]
      #RewriteCond %{REQUEST_URI} (.*)---([_0-9]+)\.html$
      #RewriteRule (.*)---([_0-9]+)\.html$ index.php?cPath=$2 [QSA,L]

      ##-- Products (--)
      #RewriteRule (.*)--(.+)\.html$ product_info.php?products_id=$2 [QSA,L]

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

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

    </IfModule>

    Harry Haller

    • Neu im Forum
    • Beiträge: 30
    Re: 301 redirect von /shop zu root
    Antwort #8 am: 04. September 2012, 14:27:14
    Hat keiner eine Idee woran da liegen könnte? Modified soll das doch können :(
    2 Antworten
    3160 Aufrufe
    30. Juli 2012, 10:35:12 von Toby
    15 Antworten
    7590 Aufrufe
    03. Mai 2014, 13:20:54 von Mephisto86
    3 Antworten
    5292 Aufrufe
    23. Mai 2011, 11:32:33 von DokuMan