301重定向到htaccess以重定向url

时间:2016-06-16 09:22:05

标签: .htaccess redirect

我想重定向一下,请指导我

表格

  • textview

  • http://example.com/babycare/testimonials.php?id=7

1 个答案:

答案 0 :(得分:1)

重定向

  • http://example.com/babycare/testimonials.php?id=7

  • http://example.com/babycare/testimonial/cat/1

您可以使用以下规则:

RewriteEngine on

RewriteCond %{THE_REQUEST} /babycare/testimonials\.php\?id=([0-9]+)  [NC]
RewriteRule ^ /babycare/testimonial/cat/%1? [L,R]