Pomoc - Szukaj - Użytkownicy - Kalendarz
Pełna wersja: .htaccess
Forum PHP.pl > Forum > PHP
SET
.htaccess
  1. <?php
  2. ErrorDocument 401 /strona%201/index.php
  3.  
  4. AuthUserFile /strona%201/admin/.htpass
  5. AuthGroupFile /dev/null
  6. AuthName &#092;"Nazwa\"
  7. AuthType Basic
  8. require valid-user
  9. ?>


.htpass (wygenerowany przez htpasswd)
  1. <?php
  2. tomek:$apr1$jU......$.4Kv9ewR.UTsvfYchMiVd.
  3. ?>


otwieram katalog -> wyswietla się form logowania -> wpisuje nazwa uz i haslo -> i nic ?

windows xp,

z góry thx, smile.gif smile.gif smile.gif smile.gif smile.gif smile.gif
dr_bonzo
http://httpd.apache.org/docs-2.0/howto/auth.html

Nie podajesz prawidlowo sciezki do plikow:
Cytat
The AuthUserFile directive sets the name of a textual file containing the list of users and passwords for user authentication. File-path is the path to the user file. If it is not absolute (i.e., if it doesn't begin with a slash), it is treated as relative to the ServerRoot.


Kod
ErrorDocument 401 /strona%201/index.php
AuthUserFile /strona%201/admin/.htpass
AuthGroupFile /dev/null

// zmien na

ErrorDocument 401 C:/jakis_katalog/strona%201/index.php
AuthUserFile C:/jakis_katalog/strona%201/admin/.htpass
AuthGroupFile ... // mozesz usunac ta linie

Skoro uzywasz windowsa to nie mozesz podawac unixowych sciezek.
SET
zmieniłem i jak dam anuluj to mnie nie przekierowywuje na strone główną ? (/strona%201/index.php -> to przekierowało poprawnie), po drugie wpisuje nazwe uz i haslo -> daje ok i znowu pojawia sie formularz logowania ?

httpd
Kod
<Directory "C:\Apache\Apache2\htdocs">
    AllowOverride FileInfo AuthConfig Limit
    Options MultiViews Indexes SymLinksIfOwnerMatch IncludesNoExec
    <Limit GET POST OPTIONS PROPFIND>
        Order allow,deny
        Allow from all
    </Limit>
    <LimitExcept GET POST OPTIONS PROPFIND>
        Order deny,allow
        Deny from all
    </LimitExcept>
</Directory>
To jest wersja lo-fi głównej zawartości. Aby zobaczyć pełną wersję z większą zawartością, obrazkami i formatowaniem proszę kliknij tutaj.
Invision Power Board © 2001-2025 Invision Power Services, Inc.