htaccess https

  • Creatore Discussione Creatore Discussione azarok
  • Data di inizio Data di inizio

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