Mempercantik Url Website Dengan .htaccess

 




1


2


2


3


4

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*)$ settings_uri.php?do=$1 [QSA,L]

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
RewriteCond %{REQUEST_URI} zona
RewriteRule ^(.*)$ https://zona.trijayamakmur.net/zona/$1 [R,L]

5

<?php
$do = explode("/", $_REQUEST['do']);
$opsi = $do[0];
define('PUB_DIR', dirname (__FILE__) . '/');
switch($opsi) {
    case '':
        require_once (PUB_DIR . 'index.php');
    break;
    case 'login':
        require_once (PUB_DIR . 'login.php');
    break;
    case 'logout':
        require_once (PUB_DIR . 'logout.php');
    break;
    case 'dashboard':
        require_once (PUB_DIR . 'dashboard.php');
    break;
    // jika tidak ada file nya
    default:
        require_once(PUB_DIR . '404.php');
}
?>

6

0 komentar:

Post a Comment