我不知道,如何描述我的问题,但我会尝试。
我已经构建了自己的模板,其中一部分正在运行,但如果我点击一个链接,我希望有两个部分正在改变。
它正在我的index.php工作,如果我点击其他链接,但如果我点击新闻回到新闻(这是我的家(index.php)),我将进入目录浏览器。
我的文件夹结构:
我的htaccess:
RewriteEngine On
RewriteBase /inexorablez/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?site=$1 [L,QSA]
我的导航文件:
<nav>
<ul>
<li><a href="News">News</a></li>
<li><a href="Teams">Teams</a></li>
<li><a href="Downloads">Downloads</a></li>
<li><a href="Partner">Partner</a></li>
</ul>
</nav>
my index.php:
if( isset( $_GET['site'] ) ) {
$site = $_GET['site'];
} else {
$site = 'News';
}
?>
<!DOCTYPE html>
<html>
<head>
<title>inexoarablez</title>
<link rel="stylesheet" href="unslider/dist/css/unslider.css">
<link rel="stylesheet" href="unslider/dist/css/unslider-dots.css">
<link rel="stylesheet" href="font-awesome-4.5.0/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="css/style.css">
</head>
<body>
<!-- wrapper start -->
<div id="wrapper">
<div id="header">
<div id="col-left">
<!-- logo section start -->
<div id="logo-section">
<div id="logo"></div>
<h1>inexorablez</h1>
</div>
<!-- logo section end -->
</div>
<div id="col-right">
<!-- navigation start -->
<?php require( "includes/navigation.inc.php" ); ?>
<!-- navigation end -->
<!-- news start -->
<div id="news">
<?php
// Navigation
switch ( $site ) {
case 'News':
include( 'news/news.news.php' );
break;
case 'Teams':
include( 'news/teams.news.php' );
break;
case 'Downloads':
include( 'news/downloads.news.php' );
break;
case 'Partner':
include( 'news/partner.news.php' );
break;
default:
include( 'news/news.news.php' );
break;
}
?>
</div>
<!-- news end -->
</div>
</div>
<div id="main">
<div id="content">
<?php
// Navigation
switch ( $site ) {
case 'News':
include( 'sites/news.php' );
break;
case 'Teams':
include( 'sites/teams.php' );
break;
case 'Downloads':
include( 'sites/downloads.php' );
break;
case 'Partner':
include( 'sites/partner.php' );
break;
default:
include( 'sites/news.php' );
break;
}
?>
</div>
</div>
<!-- footer start -->
<footer>
fsdgdsfgfdsg
</footer>
<!-- footer end -->
</div>
<!-- wrapper end -->
<!-- scripts -->
<script src="//code.jquery.com/jquery-2.1.4.min.js"></script>
<script src="unslider/src/js/unslider.js"></script> <!-- but with the right path! -->
<script>
jQuery(document).ready(function($) {
$('.my-slider').unslider({
autoplay: true
});
});
</script>
这里有一个jsfiddle: jsfiddle
对不起我的英语,我觉得有些不对劲,但我真的不知道是什么......
它正在处理我的index.php和所有其他链接,但不在“新闻”链接上,如果我点击“新闻”链接,我将获得文件夹结构。
答案 0 :(得分:0)
如果要禁用目录列表,请将此行添加到.htaccess文件
Options -Indexes
每个目录中都可以有一个.htaccess文件
inexorablez/unslider/.htaccess
indexorablez/News/.htaccess
和/或在根
indexorablez/.htaccess