url重写不在我的页面上工作

时间:2015-08-31 17:12:39

标签: php .htaccess url-rewriting

我有以下代码:

<?php 
    //Fetching the Category Name
    $sql="SELECT * FROM subcategory WHERE CategoryID='$catid'";
    $rs = mysql_query($sql) or die(mysql_error());
    while($row = mysql_fetch_array($rs)){   
?>
<a href="questions.php?scid=<?php echo $row['SubCategoryID']; ?>"><?php echo $row['SubCategoryName']; ?></a>
<?php } ?>

我已经完成了.htaccess文件,但重写仍无法正常工作。

mysite/article.php?scid=9&page=1

我希望他们为mysite.com/categoryname_description_subcategoryname-1

1 个答案:

答案 0 :(得分:0)

您应该将您在设计/ html布局中使用的链接名称更改为我在下面发布的示例 <a href="question/categoryname/categoryid.html"</a>