Advertisement
Guest User

Untitled

a guest
Aug 3rd, 2015
159
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.74 KB | None | 0 0
  1. RewriteEngine On
  2.  
  3. RewriteCond %{REQUEST_FILENAME} !-f
  4. RewriteCond %{REQUEST_FILENAME} !-d
  5.  
  6. RewriteRule ^(.*)$ index.php?pagina=$1
  7.  
  8.  
  9. INCLUDES DE PÁGINAS
  10.  
  11.  
  12. function getHome(){
  13. $url = $_GET['pagina'];
  14. $url = explode('/', $url);
  15. $url[0] = ($url[0] == NULL ? 'content' : $url[0]);
  16.  
  17.  
  18. if(file_exists('tpl/'.$url[0].'.php')){
  19. require_once('tpl/'.$url[0].'.php');
  20. }elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'.php')){
  21. require_once('tpl/'.$url[0].'/'.$url[1].'.php');
  22. }elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php')){
  23. require_once('tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php');
  24. }else{
  25. require_once('tpl/404.php');
  26. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement