Advertisement
mahadisuta

codeigniter remove index.php?p=

Mar 18th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. //CONFIG.PHP
  2. $http = 'http' . ((isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == 'on') ? 's' : '') . '://';
  3. $root = $http.$_SERVER['HTTP_HOST'];
  4. $root .= str_replace(basename($_SERVER['SCRIPT_NAME']),"",$_SERVER['SCRIPT_NAME']).'/';
  5. $config['base_url'] = $root;
  6. $config['index_page'] = '';
  7. $config['uri_protocol'] = 'REQUEST_URI';
  8.  
  9. //HTACCESS
  10. <IfModule mod_rewrite.c>
  11. RewriteEngine on
  12. RewriteCond $1 !^(index\.php|resources|robots\.txt)
  13. RewriteCond %{REQUEST_FILENAME} !-f
  14. RewriteCond %{REQUEST_FILENAME} !-d
  15. RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]
  16. </IfModule>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement