Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- RewriteEngine On
- RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
- RewriteRule ^(.*)$ index.php?pagina=$1
- INCLUDES DE PÁGINAS
- function getHome(){
- $url = $_GET['pagina'];
- $url = explode('/', $url);
- $url[0] = ($url[0] == NULL ? 'content' : $url[0]);
- if(file_exists('tpl/'.$url[0].'.php')){
- require_once('tpl/'.$url[0].'.php');
- }elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'.php')){
- require_once('tpl/'.$url[0].'/'.$url[1].'.php');
- }elseif(file_exists('/tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php')){
- require_once('tpl/'.$url[0].'/'.$url[1].'/'.$url[2].'.php');
- }else{
- require_once('tpl/404.php');
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement