.htaccess 使用类别名称的HTACCESS重写URL
我想用htaccess重写URL。。。用于转换以下URL.htaccess 使用类别名称的HTACCESS重写URL,.htaccess,mod-rewrite,url-rewriting,.htaccess,Mod Rewrite,Url Rewriting,我想用htaccess重写URL。。。用于转换以下URL 到 我不想在url中写分类,我使用下面的代码,但没有用 RewriteRule ^(.*)/ category.php?id=$1 RewriteRule ^(.*) category.php?id=$1 您需要使用RewriteCond来操作查询字符串 RewriteEngine on RewriteCond %{THE_REQUEST} /category\.php\?id=([^\s&]+) [NC
RewriteRule ^(.*)/ category.php?id=$1
RewriteRule ^(.*) category.php?id=$1
您需要使用RewriteCond来操作查询字符串
RewriteEngine on
RewriteCond %{THE_REQUEST} /category\.php\?id=([^\s&]+) [NC]
RewriteRule ^ /%1? [NE,L,R]
您需要使用RewriteCond来操作查询字符串
RewriteEngine on
RewriteCond %{THE_REQUEST} /category\.php\?id=([^\s&]+) [NC]
RewriteRule ^ /%1? [NE,L,R]