Skip to content

Instantly share code, notes, and snippets.

@inuvalogic
Last active February 23, 2017 13:10
Show Gist options
  • Save inuvalogic/e1167db0d490066376f8a6021a1dd804 to your computer and use it in GitHub Desktop.
Save inuvalogic/e1167db0d490066376f8a6021a1dd804 to your computer and use it in GitHub Desktop.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /hpdki/
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^(.+)$ index.php?url=$1 [L]
</IfModule>
<?php
$base_url = 'http://'.$_SERVER['HTTP_HOST'].'/hpdki';
?>
<!DOCTYPE html>
<html>
<head>
<title>HPDKI</title>
<link rel="stylesheet" type="text/css" href="css/owl.carousel.min.css">
<link rel="stylesheet" type="text/css" href="css/owl.theme.default.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<header id="slide">
<div class="owl-carousel owl-theme">
<div class="item">
<img src="images/1.jpg">
</div>
<div class="item">
<img src="images/2.jpg">
</div>
</div>
</header>
<nav id="menu">
<ul>
<li><a href="<?php echo $base_url; ?>">Home</a></li>
<li><a href="<?php echo $base_url; ?>/news">News &amp; Event</a></li>
<li><a href="<?php echo $base_url; ?>/profile">Profile Organisasi</a></li>
</ul>
</nav>
<?php
if (isset($_GET['url']))
{
$url = trim($_GET['url'], '/');
$url = explode('/', $url);
if (isset($url[0]))
{
$filename = 'page/'.$url[0].'.php';
if (file_exists($filename))
{
require_once $filename;
} else {
require_once 'page/error.php';
}
} else {
require_once 'page/home.php';
}
} else {
require_once 'page/home.php';
}
?>
<script type="text/javascript" src="js/jquery-3.1.1.min.js"></script>
<script type="text/javascript" src="js/owl.carousel.min.js"></script>
<script type="text/javascript">
$('.owl-carousel').owlCarousel({
loop:true,
margin:10,
nav:false,
items:1,
autoplay:true,
dots: true
});
</script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment