Php .htaccess重写规则允许重复内容
我有这个.htaccess代码来重写urlPhp .htaccess重写规则允许重复内容,php,.htaccess,Php,.htaccess,我有这个.htaccess代码来重写url RewriteRule ^co/prepagos_([a-z]+).htm$ /dir/city.php?scity=$1&pagina=mujeres&pais=2 它与 我只希望1号文件有效,而不是2号文件,因为google web master将其视为重复内容。有什么想法吗 用以下内容替换您的规则: RewriteCond %{QUERY_STRING} ^$ RewriteRule ^co/prepagos_([a-z]+
RewriteRule ^co/prepagos_([a-z]+).htm$ /dir/city.php?scity=$1&pagina=mujeres&pais=2
它与
我只希望1号文件有效,而不是2号文件,因为google web master将其视为重复内容。有什么想法吗 用以下内容替换您的规则:
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^co/prepagos_([a-z]+)\.htm$ /co/city_view.php?scity=$1&pagina=mujeres&pais=2 [L,QSA]
这将确保仅当查询字符串为空时才应用重写规则。用以下内容替换规则:
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^co/prepagos_([a-z]+)\.htm$ /co/city_view.php?scity=$1&pagina=mujeres&pais=2 [L,QSA]
这将确保仅当查询字符串为空时才应用重写规则。非常感谢它完美地工作真正感谢它完美地工作