求助 .htaccess问题?
apache .htaccess 伪静态重写问题。
3个页面
news.php:
.htaccess:
content.php:
访问报404
3个页面
news.php:
<?php
$db=mysqlconnect(“localhost”,”root”,”123456”); //创建数据库连接
mysql_select_db(“test”,$db) or die(“数据库链接错误”);
mysql_query(“set names utf8”);
$sql=”select * from news”;
$row=mysql_query($sql);
while($result=mysql_fetch_array($row)){
?>
<a href=”content<?php echo $result[“id”]?>.html”>
<?php echo $result[“title”].”
“;?>
<?php }?>
.htaccess:
RewriteEngine on
RewriteRule ^/content_(.*).html$ /content.php?id=$1
content.php:
<?php
$id=$_GET[“id”];
echo $id;
?>
访问报404
1 个回复
brean
赞同来自: