Created
September 4, 2019 18:52
-
-
Save rmsaitam/e6599dbc58007ba6e776807ea7554ed4 to your computer and use it in GitHub Desktop.
Configuração de BASE_URL para ambiente de produção e desenvolvimento
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//PRODUÇÃO | |
if (isset($_SERVER['HTTPS']) && | |
($_SERVER['HTTPS'] == 'on' || $_SERVER['HTTPS'] == 1) || | |
isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && | |
$_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') | |
{ | |
define('BASE_URL', 'https://dominio.com.br/'); | |
} | |
//DESENVOLVIMENTO | |
else | |
{ | |
define('BASE_URL', 'http://app.local'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment