Skip to content

Instantly share code, notes, and snippets.

@jufianto
Created December 31, 2020 07:32
Show Gist options
  • Save jufianto/c3e5f5894739de2d17bc190819d097f6 to your computer and use it in GitHub Desktop.
Save jufianto/c3e5f5894739de2d17bc190819d097f6 to your computer and use it in GitHub Desktop.
CodeIgniter 3 Setting
$config['base_url'] = ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") ? "https" : "http");
$config['base_url'] .= "://".$_SERVER['HTTP_HOST'];
$config['base_url'] .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']);/'
$config['index_page']='';
<IfModule mod_rewrite.c>
Options -Indexes
RewriteEngine On
RewriteCond $1 !^(index\\.php|resources|robots\\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?/$1 [L,QSA]
</IfModule>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment