Skip to content

Commit

Permalink
Dynamic Base URL
Browse files Browse the repository at this point in the history
  • Loading branch information
mahadisuta authored May 15, 2020
0 parents commit 40c49f5
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Constants.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<?php

//Other configuration Constant default

//Add script below to setup dynamic base url on Codeigniter 4
$base = isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off' ? 'https://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']) : 'http://'.$_SERVER['HTTP_HOST'].dirname($_SERVER['SCRIPT_NAME']);

defined('BASE') || define('BASE', $base);

0 comments on commit 40c49f5

Please sign in to comment.