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: Bräuchte Hilfe/Tipp bei einem .htaccess Problem

    derheiko

    • Fördermitglied
    • Beiträge: 470
    • Geschlecht:
    Hallo zusammen,

    ich bin bei all-inkl und habe ein Verzeichnis in dem durch einen Cronjob angestoßene SQL Backups landen.

    Als Beispiel www.shop.de/backup/datenbank_backup.php

    Die ist durch eine .htaccess mit Passwort geschützt.

    Seit zwei Wochen kann der Cronjob dieses Verzeichnis nicht öffnen, weil die übergeornete .htaccess vom Shop den Zugang verweigert.

    Möchte ich mit dem Browser die PHP Datei öffnen, dann leitet mich der Shop auf folgende Seite:

    https://www.****.de/sitemap.html?error=401

    [ Für Gäste sind keine Dateianhänge sichtbar ]

    Ich erhalte die Meldung: Fehler 401: Authentifizierungsfehler.

    Schalte ich die übergeordnete Shop .htaccess aus - so komme ich auf die Seite.

    Ich wäre euch sehr dankbar wenn ihr euch den Inhalt meiner .htaccess einmal kurz anschaut, weil ich finde den Grund nicht warum er dahin umleitet.

    Code: PHP  [Auswählen]
    # Scripte Laufzeit für Warenwirtschaft Shopsync
    php_value upload_max_filesize 20M
    php_value post_max_size 20M
    php_value max_execution_time 5000
    php_value max_input_time 2000
    php_value memory_limit 512M

    # phpversion
    #AddHandler php71-cgi .php


    # Ländersperre
    <IfModule mod_geoip.c>
    GeoIPEnable On
    SetEnvIf GEOIP_COUNTRY_CODE (CN|RU) BlockCountry
    Deny from env=BlockCountry
    </IfModule>

    # IPsperre
    <Limit GET POST HEAD>
    order allow,deny

    deny from 80.246.188.132
    deny from 136.243.36.84
    deny from 36.5.249


    allow from all
    </Limit>

    #====================================================================================================
    # Badbots blockieren [Letzte Aktualisierung: 14.06.2017]
    #====================================================================================================
    RewriteCond %{HTTP_USER_AGENT} Wotbox/2.01                                                       [OR]
    RewriteCond %{HTTP_USER_AGENT} MJ12bot/v1.4.5                                                    [OR]
    RewriteCond %{HTTP_USER_AGENT} Majestic-SEO                                                      [OR]
    RewriteCond %{HTTP_USER_AGENT} MJ12bot                                                           [OR]
    RewriteCond %{HTTP_USER_AGENT} SEOkicks-Robot                                                    [OR]
    RewriteCond %{HTTP_USER_AGENT} MegaIndex.ru/2.0                                                  [OR]
    RewriteCond %{HTTP_USER_AGENT} SemrushBot/1~bl                                                   [OR]
    RewriteCond %{HTTP_USER_AGENT} SemrushBot/1.1~bl                                                 [OR]
    RewriteCond %{HTTP_USER_AGENT} GrapeshotCrawler/2.0                                              [OR]
    RewriteCond %{HTTP_USER_AGENT} seoscanners.net/1                                                 [OR]
    RewriteCond %{HTTP_USER_AGENT} Apache-HttpClient                                                 [OR]
    RewriteCond %{HTTP_USER_AGENT} DotBot/1.1                                                        [OR]
    RewriteCond %{HTTP_USER_AGENT} crawler.datenmarkt.de/Nutch-1.11                                  [OR]
    RewriteCond %{HTTP_USER_AGENT} Java/1.7.0_79                                                     [OR]
    RewriteCond %{HTTP_USER_AGENT} AhrefsBot                                                         [OR]
    RewriteCond %{HTTP_USER_AGENT} ImplisenseBot                                                     [OR]
    RewriteCond %{HTTP_USER_AGENT} GetintentCrawler                                                  [OR]
    RewriteCond %{HTTP_USER_AGENT} OFM                                                               [OR]
    RewriteCond %{HTTP_USER_AGENT} finbot                                                            [OR]
    RewriteCond %{HTTP_USER_AGENT} Exabot                                                            [OR]
    RewriteCond %{HTTP_USER_AGENT} proximic                                                          [OR]
    RewriteCond %{HTTP_USER_AGENT} linkdexbot                                                        [OR]
    RewriteCond %{HTTP_USER_AGENT} BLEXBot                                                           [OR]
    RewriteCond %{HTTP_USER_AGENT} spbot                                                             [OR]
    RewriteCond %{HTTP_USER_AGENT} SMTBot                                                            [OR]
    RewriteCond %{HTTP_USER_AGENT} Searchie                                                          [OR]
    RewriteCond %{HTTP_USER_AGENT} Plukkie                                                           [OR]
    RewriteCond %{HTTP_USER_AGENT} MetaJobBot                                                        [OR]
    RewriteCond %{HTTP_USER_AGENT} sSearch                                                           [OR]
    RewriteCond %{HTTP_USER_AGENT} WBSearchBot                                                       [OR]
    RewriteCond %{HTTP_USER_AGENT} c7.seokicks.de                                                    [OR]
    RewriteCond %{HTTP_USER_AGENT} TwengaBot-2.0                                                     [OR]
    RewriteCond %{HTTP_USER_AGENT} Cliqzbot/0.1                                                      [OR]
    RewriteCond %{HTTP_USER_AGENT} Cliqzbot                                                          [OR]
    RewriteCond %{HTTP_USER_AGENT} SearchmetricsBot                                                  [OR]
    RewriteCond %{HTTP_USER_AGENT} SISTRIX
    RewriteRule ^ - [F,L]

    ##-- $Id: _.htaccess 10674 2017-04-11 09:19:49Z Tomcraft $

    ##-- 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
      RequestHeader unset Proxy
    </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>

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

    # Disable directory browsing (disabled by default as this causes problems on some servers because they don't allow AllowOverride Directive for Options)
    #Options -Indexes

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

    ##-- Customization of HTTP request and response headers
    <IfModule mod_headers.c>
      <FilesMatch "\\.(ico|jpe?g|png|gif|swf|flv|svg)$">
        Header set Cache-Control "max-age=2592000, public"
      </FilesMatch>
      <FilesMatch "\\.(css|woff)$">
        Header set Cache-Control "max-age=604800, public"
      </FilesMatch>
      <FilesMatch "\\.(js)$">
        Header set Cache-Control "max-age=604800, private"
      </FilesMatch>
      <FilesMatch "\\.(xml|txt)$">
        Header set Cache-Control "max-age=604800, 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/jpg "access plus 2592000 seconds"
      ExpiresByType image/jpeg "access plus 2592000 seconds"
      ExpiresByType image/png "access plus 2592000 seconds"
      ExpiresByType image/svg+xml "access plus 2592000 seconds"
      ExpiresByType text/html "access plus 1 seconds"
      ExpiresByType text/css "access plus 604800 seconds"
      ExpiresByType text/javascript "access plus 604800 seconds"
      ExpiresByType application/x-javascript "access plus 604800 seconds"
      ExpiresByType application/javascript "access plus 604800 seconds"
      ExpiresByType text/x-component "access plus 604800 seconds"
      ExpiresByType application/font-woff "access plus 604800 seconds"
      ExpiresByType image/x-icon "access plus 604800 seconds"

      <IfModule mod_headers.c>
        Header append Cache-Control "public"
      </IfModule>
    </IfModule>

    ##-- Configure php_flags if necessary
    ##-- BEGIN - 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 ''

    ##-- END - use IfModule clause if PHP runs in CGI mode, otherwise just uncomment the lines with php_flag...
    #</IfModule>

    ##-- Redirect error pages to Sitemap
    ##-- set the correct Path to ErrorDocument
    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

    <FilesMatch "\.(gif|jpe?g|png)$">
    ErrorDocument 404 /404.jpg
    </FilesMatch>

    ##-----------------------------------------
    ##- SEO Shopstat Modul (Hartmut Koenig)
    ##-----------------------------------------
    <IfModule mod_rewrite.c>
      ##-- Initialize and enable rewrite engine
     ##-- Documentation http://httpd.apache.org/docs/misc/rewriteguide.html
     RewriteEngine On

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

      ##-- disallow access to dotfiles (.htaccess, .svn, .git, etc.)
     RedirectMatch 403 /\.
     
      ##-- Use canonical URLs
     ##-- Use SSL-Proxy
     ##-- HostEurope
     #RewriteCond %{HTTP:X-Forwarded-Server} !^ssl\.webpack\.de$ [NC]
     ##-- 1und1
     #RewriteCond %{HTTP:X-Forwarded-Server} !^ssl\.kundenserver\.de$ [NC]
     ##-- domainFACTORY
     #RewriteCond %{HTTP:X-Forwarded-Server} !^sslsites\.de$ [NC]
     ##-- All-Inkl
     #RewriteCond %{HTTP:X-Forwarded-Server} !^ssl-account\.com$ [NC]
     ##-- Strato
     #RewriteCond %{HTTP:X-Forwarded-Server} !^www\.ssl-id\.de$ [NC]
     
      ##-- redirect to http www-domain, when www is missing and no subdomain given and not using an ssl-proxy
     #RewriteCond %{HTTP_HOST} !^www\. [NC]
     #RewriteCond %{HTTP_HOST} !\.(.*)\. [NC]
     #RewriteCond %{HTTP_HOST} !^localhost [NC]
     #RewriteRule ^ http://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##-- redirect to https www-domain, when www is missing and no subdomain given and not using an ssl-proxy
     RewriteCond %{HTTP_HOST} !^www\. [NC]
      RewriteCond %{HTTP_HOST} !\.(.*)\. [NC]
      RewriteCond %{HTTP_HOST} !^localhost [NC]
      RewriteRule ^ https://www.%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
      RewriteCond %{SERVER_PORT} !^443$
      RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

      ##-- redirect to https non-www-domain, when no subdomain given and not using an ssl-proxy
     #RewriteCond %{SERVER_PORT} !^443$ [OR]
     #RewriteCond %{HTTP_HOST} ^www\. [NC]
     #RewriteCond %{HTTP_HOST} ^(?:www\.)?(.+)$ [NC]
     #RewriteRule ^ https://%1%{REQUEST_URI} [R=301,L]

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

      ##----------------------------------------------------------------------------------
     ##-- When working with SEO-Urls you can decide, whether 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 (:::)
     RewriteRule :::([_0-9]+):([_0-9]+)\.html$ index.php?cPath=$1&page=$2 [QSA,L]
      RewriteRule :::([_0-9]+)\.html$ index.php?cPath=$1 [QSA,L]

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

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

      ##-- Manufacturers (:.:)
     RewriteRule :.:([_0-9]+):([_0-9]+)\.html$ index.php?manufacturers_id=$1&page=$2 [QSA,L]
      RewriteRule :.:([0-9]+)\.html$ index.php?manufacturers_id=$1 [QSA,L]

      ##-- Use dash delimiter "-" for SEO-URLS (alternative setting i.e. for windows servers)
     ##-- Categories (---)
     RewriteRule ---([_0-9]+)-([_0-9]+)\.html$ index.php?cPath=$1&page=$2 [QSA,L]
      RewriteRule ---([_0-9]+)\.html$ index.php?cPath=$1 [QSA,L]

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

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

      ##-- Manufacturers (-.-)
     RewriteRule -.-([_0-9]+)-([_0-9]+)\.html$ index.php?manufacturers_id=$1&page=$2 [QSA,L]
      RewriteRule -.-([0-9]+)\.html$ index.php?manufacturers_id=$1 [QSA,L]
    </IfModule>

     Vielen lieben dank vorab für die Hilfe.

    Gruß Heiko

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

    webald

    • modified Team
    • Beiträge: 2.791
    Re: Bräuchte Hilfe/Tipp bei einem .htaccess Problem
    Antwort #1 am: 19. Juni 2017, 13:46:44
    Bin überhaupt nicht der htaccess-Crack aber ich werd aus dem was du schreibst nicht schlau

    Du schreibst, dass du ein Verzechnis per htaccess passwortgeschützt hast. Wo steht das in Deiner htaccess?

    Du hast etliche Weiterleitungsregeln in deiner htaccess. Warum, wenn du nur ein Verzeichnis schützen willst?

    Jürgen

    • Viel Schreiber
    • Beiträge: 895
    • Geschlecht:
    Re: Bräuchte Hilfe/Tipp bei einem .htaccess Problem
    Antwort #2 am: 19. Juni 2017, 13:49:48
    ...ich vermute mal das der Verzeichnisschutz im Verzeichnis selbst als htaccess liegt?

    derheiko

    • Fördermitglied
    • Beiträge: 470
    • Geschlecht:
    Re: Bräuchte Hilfe/Tipp bei einem .htaccess Problem
    Antwort #3 am: 19. Juni 2017, 15:10:07
    Entschuldigung, ich habe zuviel geschrieben.

    Vergiss das mit dem Kennwort. Das gilt für das Backup Verzeichnis. Hat keine Bedeutung.

    Also, ich möchte folgende URL aufrufen:

    https://www.*****.de/backup/datenbank_backup.php

    kann dies aber nicht, weil die .htaccess vom shop - also die im Hauptverzeichnis liegt - mich nicht lässt.

    Ich erhalte beim Aufruf der oben genannten Adresse die Meldung:

    Fehler 401: Authentifizierungsfehler.

    bzw. werde im Shop auf die Seite https://www.****.de/sitemap.html?error=401 umgeleitet.

    Da dies nicht passiert wenn ich die .htaccess entferne - vermute ich mal das ich irgendwas falsch eingestellt habe - so das er diese Umleitung macht.

    derheiko

    • Fördermitglied
    • Beiträge: 470
    • Geschlecht:
    Re: Bräuchte Hilfe/Tipp bei einem .htaccess Problem
    Antwort #4 am: 21. Juni 2017, 13:38:11
    Ich hab den Fehler gefunden, durch Zufall.

    Ich habe im Zuge des Umzuges auf modified 2.x, php7.1 und Voll SSL auch gleich ein www. erzwungen.

    Also https://www.domain.... - das Cronscript hat aber noch auf http://domain..... zugegriffen.

    Nach dem ich dem Cronjob die https://www. eingetragen lief er wieder.

    Danke dennoch für eure Hilfe.

    Gruß Heiko
    2 Antworten
    2601 Aufrufe
    24. Januar 2015, 15:19:31 von Dart Shop Frankfurt
    2 Antworten
    2822 Aufrufe
    13. Oktober 2011, 20:35:08 von stevie476
    56 Antworten
    32840 Aufrufe
    19. Juni 2014, 23:31:54 von Tomcraft
    9 Antworten
    11070 Aufrufe
    30. April 2009, 23:03:08 von Anonym
               
    anything