Jump to content

Redirecionamento Https


Recommended Posts

tem uma forma em php e em htaccess vou postar as duas aqui.

 

php:

<?php
$nomescript = $_SERVER['SCRIPT_NAME'];
$nomehost = $_SERVER['SERVER_NAME'];
if(!$_SERVER['HTTPS'])
{
$protocolo = 'https://';
header( “Location: “.$protocolo.$nomehost.$nomescript);
}
?>

Forma simplificada do php:

<?php
if($SERVER_PORT == 80) // normal http
{
header("Location: https://www.clahost.com.br/");
}
?> 

Crie um arquivo .htaccess e coloque isto:

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

Hospedagem, Revendas, Servidores VPS - [Adven Host]

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...

Important Information

Do you agree with our terms?