朋友所以我创建seo友好的博客工作正常但我面临一个问题,就是说我在菜单中放置像index.php这样的链接contact.php所有这些作品都找到但是在我的article.php中,如果我不添加像http://localhost/blog/index.php这样的完整网址
,它就不起作用希望你得到我想说的话?
这是我的article.php页面我如何获取记录
$url = $_SERVER['REQUEST_URI'];
$url = str_replace('/blog/', '', ucwords($url));
//$sql=mysql_query("SELECT id,title,keyword,description,image,youtube,article,created,views FROM article WHERE url='".$url1."'");
$stmt = $db->prepare("SELECT id,title,keyword,description,image,youtube,article,created,views FROM article WHERE url = :url");
$stmt->bindParam(':url', $url, PDO::PARAM_STR);
$stmt->execute();
$row = $stmt->fetch();
$count = $stmt->rowCount();
//$count = mysql_num_rows($sql);
if($count <1){
header("Location: ".$site_path."index.php");
exit();
}
$qry = "UPDATE article SET views = views +1 WHERE url = :url";
$stm = $db->prepare($qry);
$stm->bindParam(':url', $url, PDO::PARAM_STR);
$stm->execute();
//mysql_query("UPDATE article SET views = views +1 WHERE url ='".$url."'");
//$row=mysql_fetch_array($sql);
和htaccess是
RewriteEngine On
RewriteBase /blog/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\?*$ article.php?$1 [L,QSA]
我如何解决article.php页面中的问题,就像我网站上的每个其他页面一样,即使在这个页面上,我也可以添加url作为index.php和除了必须使用http://localhost/blog/index.php之外的任何bla.php / p>
非常感谢