htaccess https

azarok

Nuovo Utente
30 Mag 2008
7
0
0
Salve, ho un problema nella configurazione di htaccess su un webserver online.

Vorrei far si che alcune determinate pagine, precisamente quelle del login vengano criptate attraverso https.

Allego il codice:

<Files "listator.php">
<IfModule mod_ssl.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
<IfModule !mod_ssl.c>
order allow,deny
</IfModule>
</Files>

In questo caso quando si arriva al file listator.php url diventa https, ma anche dopo aver effettuato il logout o vado direttamente alla homepage (index.php) url rimane sempre in https.

Un altra cosa strana quando url e' https, non vengono caricate tutte le immagini presenti nel sito.

Alleggo tutto il codice del file htaccess

RewriteEngine on
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName seven.com
AuthUserFile /home/seven/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/seven/public_html/_vti_pvt/service.grp

RewriteCond %{HTTP_REFERER} !^http://seven.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://seven.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seven.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seven.com$ [NC]
RewriteRule .*\.(jpg|jpeg|gif|png|bmp)$ - [F,NC]

<Files "listator.php">
<IfModule mod_ssl.c>
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI}
</IfModule>
<IfModule !mod_ssl.c>
order allow,deny
</IfModule>
</Files>

Grazie infinite dell'aiuto
 
Ultima modifica:

jan267

Utente Attivo
6 Mar 2003
1.950
2
38
35
Milano
twitter.com
Beh, per prevenire l'hotlinking - giustamente - escludi qualsiasi dominio eccetto seven.com.
Peccato che ti escluda anche il dominio https://seven.com visto che non gliel'hai impostato come "legittimo".

Sostituisci:
Codice:
RewriteCond %{HTTP_REFERER} !^http://seven.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://seven.com$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seven.com/.*$ [NC]
RewriteCond %{HTTP_REFERER} !^http://www.seven.com$ [NC]
Con:
Codice:
RewriteCond %{HTTP_REFERER} !^http(s)*://(.+\.)?seven\.com/.*$ [NC]
Così dovrebbe andare...
 
Ultima modifica:

azarok

Nuovo Utente
30 Mag 2008
7
0
0
Ho trovato una soluzione valida:

Options +FollowSymLinks

RewriteEngine On

RewriteCond %{SERVER_PORT} !^80$
RewriteRule !^(listator.php|register.php|)$ ht*p://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^(listator.php|register.php|error.php|)$ ht*s://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]


RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} admin
RewriteRule ^(.*)$ RewriteRule ^(.*)$ hts://ww.seven.co/$1 [R,L]


L'unico problema e' che quando vado nella pagina di /admin/index.ph mi da errore di troppe connesioni.
 
Discussioni simili
Autore Titolo Forum Risposte Data
bubino8 [WordPress] Gestire SSL (https://) da .htaccess WordPress 9
A Utilizzare HTACCESS per HTTPS Apache 3
otto9due Proteggere una cartella e file con password tramite .htaccess e .htpasswd Web Server 0
G Aiuto con htaccess e rewriterule PHP 0
Cosina htaccess redirect 301 senza estensione html Web Server 6
felino htaccess: redirect da una subdirectory alla root Web Server 2
A [PHP] redirect htaccess PHP 5
Z Sottodomini e sottocartelle con Apache2 e Htaccess Apache 0
felino [Htaccess] Redirect per url non esistente Apache 1
Z HTACCESS e PHP MOD_REWRITE PHP 0
G [PHP] Sottodomini con .htaccess PHP 1
P htaccess ed espressioni regolari Apache 0
F htaccess e redirect 301 Apache 0
W Errore su Htaccess, mi reindirizza sempre ad una sola regola Apache 0
andreas88 Creare file .htaccess per risolvere alcuni problemi con il tester SEO SEO e Posizionamento 0
P Cerco esperto htaccess Offerte e Richieste di Lavoro e/o Collaborazione 0
O [PHP] Conflitto tra regole nel file htaccess PHP 10
I Url rewrite con .htaccess funziona ma poi mostra indirizzo "reale" nella barra di navigazione Apache 1
M htaccess Apache 0
D Aggiungere slash finale ad URL con .htaccess Web Server 2
F Regola Htaccess SEO e Posizionamento 7
SebaGravi [PHP] problema url semantici con .htaccess PHP 3
booklisa [WordPress] Errori vari console chrome, redirect file .htaccess + internalizza risorse WordPress 1
booklisa [WordPress] .htaccess questo sconosciuto... WordPress 0
A [PHP] Protezione selettiva sottocartelle con htaccess PHP 0
A [PHP] problema htaccess PHP 2
Cosina File htaccess compilazione Apache 0
D Come posso escludere una pagina dalle regole di htaccess? Web Server 0
M htaccess incompleto? Apache 0
F Regola .htaccess 301 suffisso .html SEO e Posizionamento 3
L htaccess case insensitive Apache 0
A Conflitti rules redirect htaccess PHP 1
Max 1 .htaccess e referer su server linux Web Server 0
P nginx e .htaccess HTML e CSS 8
W Session e htaccess PHP 2
MarcoGrazia [htaccess] Bloccare tutti meno il proprio sito Apache 0
R Riscrivere URL - file .htaccess e modrewrite Linux e Software 0
T Condizioni multiple in htaccess per accesso a sub folder basato su indirizzo IP Apache 0
P url rewrite htaccess Apache 0
LuigiDonato .htaccess PHP 5
anton Proteggere un file con htaccess Apache 0
N [MAMP] Problemi con htaccess.txt Apache 0
A acconsentire tramite .htaccess tutti gli ip italiani + googlebots Apache 0
A Redirect 301 .htaccess non funziona: riporto il codice inserito HTML e CSS 2
Devil-94 .htaccess rewriteRule Apache 0
V Error 404 a causa del file htaccess Apache 0
C Reindirizzamento htaccess HTML e CSS 2
R Redirect 301 con htaccess non funziona. Aiuto! PHP 1
E .htaccess PHP 0
I Php e .htaccess PHP 2

Discussioni simili