Advertisement
ztajti1992

CodeIgniter keresőbarát url kialakítás "egyszerűen"

Dec 8th, 2016
241
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.63 KB | None | 0 0
  1. #application/config/config.php
  2. $config['allow_get_array'] = TRUE;
  3. $config['enable_query_strings'] = TRUE;
  4. $config['controller_trigger'] = 'c';
  5. $config['function_trigger'] = 'm';
  6. $config['directory_trigger'] = 'd';
  7.  
  8. #application/controller/web.php (Nekem ez a main controllerem)
  9. public function index(){
  10.     $item = $_GET['item'];
  11.     if(empty($item)){$item = "index";};
  12.     (..)
  13. };
  14.  
  15. #.htaccess file
  16. DirectoryIndex index.php
  17. RewriteEngine on
  18. RewriteBase /
  19. RewriteCond %{REQUEST_FILENAME} !-f
  20. #RewriteCond %{REQUEST_FILENAME} !-d
  21. #RewriteCond %{REQUEST_FILENAME} !-l
  22. RewriteRule ^(.*).html$ /index.php?c=web&m=index&item=$1 [L]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement