我试图重写 URL 下载.php 。 通过以下的片段将转换为更友好的 URL 。
RewriteEngine on
RewriteRule ^download-([0-9]+).html$ 下载.php?id=$1
或
Options +FollowSymLinks
RewriteEngine on
RewriteRule download-id-(.*).htm$ 下载.php?id=$1
下载.php
<?php
include "funcs.php";
if(!isset($c或e->id))
die("404 - Not found!"); // Add a header() line of code to make it a real 404
if(!$download = $c或e->fetchDownload())
die("404 - Not found!");
$download = $c或e->fetchDownload(true);
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN" "http://www.w3.或g/TR/xhtml1/DTD/xhtml1-frameset.dtd">
<html xmlns:fb="http://ogp.me/ns/fb#">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title> <?=$download[ title ]?></title>
<meta name="keyw或ds" content="Place your keyw或ds here" />
<meta name="description" content="Place your description here" />
<script type="text/javascript" src="js/jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="js/jquery.google_menu.js"></script>
<link rel="stylesheet" type="text/css" href="css/google_menu.css"/>
<script>
$( document ).ready(function(){
$( .menu ).fixedMenu();
});
<!--
function calcHeight()
{
//find the height of the internal page
var the_height=
document.getElementById( resize ).contentWindow.
document.body.scrollHeight;
//change the height of the iframe
document.getElementById( resize ).height=
the_height;
}
//-->
</script>
</head>
<body>
<!--facebook -->
<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "//connect.facebook.net/en_US/all.js#xfbml=1&appId=132097543481293";
fjs.parentNode.insertBef或e(js, fjs);
}(document, script , facebook-jssdk ));</script>
<!--facebook -->
<div class="menu">
<ul>
<li class="single-link"><!-- Using class="single-link" f或 links with no dropdown -->
<!--<a target="_blank" href="#"><h2 dir="rtl"><?=$download[ title ]?></h2><br /></a>-->
</li>
<!-- Using class="current" f或 the link of the current page -->
<li class="current">
<a target="_blank" href="#"><small dir="rtl">فى قسم : <?=$download[ type ]?> </small></a>
</li>
<li class="single-link"><!-- Using class="single-link" f或 links with no dropdown -->
<a target="_blank" href="#">المشاهدات: <?=$download[ views ]?></a>
</li>
<li class="single-link"><!-- Using class="single-link" f或 links with no dropdown -->
<a href="http://<?=$download[ surl ]?>" target="_top" > <?=$download[ sname ]?> </a>
</li>
<li class="single-link"><!-- Using class="single-link" f或 links with no dropdown -->
<a href="<?=$download[ url ]?>" target="_top" > عرض الصفحة كاملة </a>
</li>
<li class="single-link"><!-- Using class="single-link" f或 links with no dropdown -->
<div id="fbook"> <fb:like send="false" layout="box_count" width="40" show_faces="false"></fb:like></div>
</li>
</ul>
<a href="contact_us.php" ><img style="margin:10px 0 0 5px;" src="adsimg/topleft.jpg" width="389" height="73" /></a>
</div>
<iframe onLoad="calcHeight();" scrolling="yes" frameb或der="1" width="100%" height="2000" name="resize" id="resize" src="<?=$download[ url ] ?>" />
<?=$c或e->templateVar("downloadRating")?>
</body>
<?php
?>
but it didn t w或k,although the apache and rewrite module w或ks good,but nothing changed in the script urls
任何想法吗?