Php .htaccess重写规则对我的链接无效

Php .htaccess重写规则对我的链接无效,php,apache,.htaccess,mod-rewrite,Php,Apache,.htaccess,Mod Rewrite,我的原始链接如下:http://sitename.com/ads.php?i=2及其重写类型如下:http://sitename.com/ads/cars/alfa-romeo-spider-in-good-condition.html 在.htaccess文件中,我这样编码:RewriteRule^ads/([^/]*)/([^/]*).html$ads.php?I=$1[L],但页面没有显示。如何在.htaccess文件中写入规则。^ads/(.+)/(.+)\.html$ads.php?I

我的原始链接如下:
http://sitename.com/ads.php?i=2
及其重写类型如下:
http://sitename.com/ads/cars/alfa-romeo-spider-in-good-condition.html


在.htaccess文件中,我这样编码:
RewriteRule^ads/([^/]*)/([^/]*).html$ads.php?I=$1[L]
,但页面没有显示。如何在.htaccess文件中写入规则。

^ads/(.+)/(.+)\.html$ads.php?I=$1[L]$1=cars,$2=alfa-romeo…我不明白你是怎么想的。htaccess可以将一个像
cars/alfa-romeo spider这样的字符串转换成一个像
I=2
这样的数字。现在我注意到了这个错误。谢谢azeos和Ultimater<代码>重写规则^ads/([^/]*)/([^/]*)-([^/]*)。html$ads.php?cat=$1&i=$2&title=$3[L]