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: Doppelte HTACCESS Passwortabfrage in Unterverzeichnis

    derluke

    • Neu im Forum
    • Beiträge: 44
    Hallo Modified Community

    ich habe einen Modified Shop in einem Unterverzeichnis installiert (/shop).
    Da der Shop nur für bestimmte Kunden aufrufbar sein soll, habe ich einen htaccess Passwortschutz eingerichtet.

    Meine HTACCESS Datei sieht so aus:

    Code: PHP  [Auswählen]
    AuthType Basic
    AuthName "Zugriff verweigert - Bitte User und Passwort eingeben"
    AuthGroupFile /dev/null
    AuthUserFile /www/htdocs/w00d1605/shop/.htpasswd

    <Limit GET>
    require valid-user
    </Limit>

    AddHandler php53-cgi .php

    ##-- $Id: .htaccess 3209 2012-07-12 11:51:11Z gtb-modified $

    ##-- 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>

    ##-- 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)
    #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
    ##-- 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


    ##-----------------------------------------
    ##- 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 /shop/

    ##-- Use canonical URLs
    ##-- redirect to www-domain, when www is missing and no subdomain given and not using an 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]

    #RewriteCond %{HTTP_HOST}                 !^www\.(.*) [NC]
    #RewriteCond %{HTTP_HOST}                 !^(.*)\.(.*)\.(.*) [NC]
    #RewriteCond %{HTTP_HOST}                 !^localhost(.*)$ [NC]
    #RewriteRule ^(.*)                        http://www.%{HTTP_HOST}/$1 [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 (:::)
    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>

     

    Die Passwortabfrage ist dabei ganz am Anfang der Datei.
    Jetzt gibt es nur ein Problem im Firefox: Die HTACCESS Passwortabfrage kommmt doppelt!
    Wenn ich die Daten zwei mal eingebe, funktioniert alles.

    Ich denke das wird so einige Kunden vergraulen und sie werden denken, sie haben das Passwort falsch eingegeben.

    Könnt ihr mir helfen / hat jemand eine Idee wieso die Passwortabfrage doppelt kommt?

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

    piru

    • Fördermitglied
    • Beiträge: 1.263
    • Geschlecht:
    Re: Doppelte HTACCESS Passwortabfrage in Unterverzeichnis
    Antwort #1 am: 21. Oktober 2013, 13:43:48
    Hallo derluke,

    ich habe die Passwortanfrage am Ende der Datei und kommt nur ein mal, und sieht so aus:

    Code: PHP  [Auswählen]
    AuthType Basic
    AuthName "Restricted Directory"
    AuthUserFile  "/kunden/homepages/30/d1xxxxxxxx/htdocs/shoptest/.htpasswd"
    require valid-user

    Gruß piru

    derluke

    • Neu im Forum
    • Beiträge: 44
    Re: Doppelte HTACCESS Passwortabfrage in Unterverzeichnis
    Antwort #2 am: 21. Oktober 2013, 13:48:59
    hallo piru,

    vielen dank für deine antwort. ich habe es jetzt an das ende der datei gesetzt und trotzdem möchte firefox das passwort doppelt haben. Könntest du mir deine htaccess posten piru?

    Ich bin aber jetzt schon ein wenig schlauer:

    1. in der ersten passwortabfrage bringt firefox die meldung, dass er gerne zugangsdaten für
    http://www.domain.de hätte

    2. in der zweiten abfrage, möchte er ein passwort für
    http://domain.de

    Das heißt, dass es am www Pfad liegt... Bin jetzt aber auch nicht weiter gekommen.

    piru

    • Fördermitglied
    • Beiträge: 1.263
    • Geschlecht:
    Re: Doppelte HTACCESS Passwortabfrage in Unterverzeichnis
    Antwort #3 am: 21. Oktober 2013, 14:17:30
    Code: PHP  [Auswählen]
    ##-- $Id: .htaccess 3209 2012-07-12 11:51:11Z gtb-modified $

    ##-- 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>

    ##-- 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)
    #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
    ##-- 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

    ##-----------------------------------------
    ##- 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 /

      ##-- Use canonical URLs
     ##-- redirect to www-domain, when www is missing and no subdomain given and not using an 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]

      #RewriteCond %{HTTP_HOST}                 !^www\.(.*) [NC]
     #RewriteCond %{HTTP_HOST}                 !^(.*)\.(.*)\.(.*) [NC]
     #RewriteCond %{HTTP_HOST}                 !^localhost(.*)$ [NC]
     #RewriteRule ^(.*)                        http://www.%{HTTP_HOST}/$1 [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 (:::)
     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>

    #-- BOF - MJF - Directory with password
    AuthType Basic
    AuthName "Restricted Directory"
    AuthUserFile  "/kunden/homepages/30/d1xxxxxxxx/htdocs/shoptest/.htpasswd"
    require valid-user
    #-- EOF - MJF - Directory with password

    derluke

    • Neu im Forum
    • Beiträge: 44
    Re: Doppelte HTACCESS Passwortabfrage in Unterverzeichnis
    Antwort #4 am: 21. Oktober 2013, 16:10:59
    Ich konnte das Problem selber lösen.
    Das Problem lag nicht an der .htaccess Datei sondern an der index.php

    Diese hatte Pfade mit und ohne www aufgerufen.
    Ich habe nun einfach die /includes/configure und admin configure.php auf www angepasst:

     
    Code: PHP  [Auswählen]
    define('HTTP_SERVER', 'http://www.domain.de'); // eg, http://localhost or - https://localhost should not be empty for productive servers
      define('HTTP_CATALOG_SERVER', 'http://www.domain.de');

    Außerdem war noch ein Link und eine Grafik auf http://domain.de gestellt.
    Modulshop - Eine große Auswahl an neuen und hilfreichen Modulen für die modified eCommerce Shopsoftware
    8 Antworten
    5183 Aufrufe
    06. August 2010, 17:53:12 von speedy
    3 Antworten
    3236 Aufrufe
    29. Oktober 2010, 20:33:38 von h-h-h
    9 Antworten
    11074 Aufrufe
    30. April 2009, 23:03:08 von Anonym
    24 Antworten
    17254 Aufrufe
    25. Oktober 2016, 09:56:31 von Bonsai