HomePage :: Categorías :: Cambios :: Indice :: Login :: Guegue.Com :: Búsqueda:

Revision [785]

Most recent edit made on 2008-03-28 10:44:41 by JavierWilson

No differences.


Revision [781]

Edited on 2008-03-28 10:39:35 by JavierWilson

Additions:
header("Location: " . "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"]);


Deletions:
header("Location: " . "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];);




Revision [780]

Edited on 2008-03-28 10:08:15 by JavierWilson

Additions:

1. Via programación, usando PHP:

2. Via .htaccess, para todo el sitio

3. Via .htaccess, para algun folder

4. En VirtualHost de httpd.conf



Deletions:

1. Via programación, usando PHP:

2. Via .htaccess, para todo el sitio

3. Via .htaccess, para algun folder

4. En VirtualHost de httpd.conf





Revision [779]

Edited on 2008-03-27 17:32:45 by JavierWilson

Additions:



Deletions:





Revision [778]

The oldest known version of this page was edited on 2008-03-27 17:32:04 by JavierWilson

HOWTO: Forzar uso de SSL


Estamos usando Apche mod_ssl:

1. Via programación, usando PHP:


if ( !isset($_SERVER['HTTPS']) || strtolower($_SERVER['HTTPS']) != 'on' ) {
  header("Location: " . "https://" . $_SERVER["SERVER_NAME"] . $_SERVER["REQUEST_URI"];);
  exit();
}

Este código se puede poner en cada archivo php que se desee redirigir a SSL, o en un include general. Alternativamente se puede usar HTTP_HOST, o simplemente header('Location: https://example.org/admin/');

2. Via .htaccess, para todo el sitio

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.example.org/$1 [R,L]


3. Via .htaccess, para algun folder

RewriteEngine On 
RewriteCond %{SERVER_PORT} 80 
RewriteCond %{REQUEST_URI} admin
RewriteRule ^(.*)$ https://www.example.org/admin/$1 [R,L]

Nota: estas opciones de .htaccess pueden usarse también en la configuración inicial de apache, por ejemplo httpd.conf, usar /admin, las direcciones no son relativas.

4. En VirtualHost de httpd.conf

<VirtualHost 192.168.0.1:80>
		ServerName www.example.org
		DocumentRoot /www/example.org/public_html
		Redirect /secure https://www.envio.org.ni/secure
</VirtualHost>



CategorySysAdmin
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki
Page was generated in 0.0362 seconds