私のファイルがcategory.php?id=
であり、ここで私のコードであるにURLをリライトする方法:私はsite.com/category/title-here/id
にURLを変更したいの.htaccess [SEOのpermlink]
<a href="category.php?id=<?php echo $row['id'];?>"><?php echo $row['name'];?></a>
。どうすれば.htaccess
で書き換えることができますか?ここで
はdetail.php
ページのための私の.htaccess
あり、それはsite.com/title-here/1
からsite.com/detail.php?id=1
として正常に動作している:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^www.name.com [NC]
RewriteRule ^(.*)$ http://name.com/$1 [L,R=301]
AddDefaultCharset UTF-8
RewriteRule ^/(css|js|img)/(.*)?$ /$1/$2 [L,QSA,R=301]
RewriteRule ^([a-zA-Z0-9-/]+)/([a-zA-Z0-9-/]+)/?$ detail.php?title=$1&id=$2
RewriteRule ^([a-zA-Z0-9-/]+)/?$ detail.php?id=$1
Options -Indexes
これは何をしようとしていますか? – darkomen
再度読んでくださいq私は –