How to redirect URLs based on query string?

前端 未结 2 489
有刺的猬
有刺的猬 2020-11-27 07:03

I successfully mass migrated a Wordpress site to Drupal. Unfortunately in Wordpress, the content URL\'s were something like www.example.org/?p=123. My domain is still the

2条回答
  •  北海茫月
    2020-11-27 07:19

    neither Redirect nor RedirectMatch allow you to specify a query string for the redirect source. [Source]

    You have to use mod-rewrite for redirecting based on query string:

    RewriteCond %{QUERY_STRING}  ^p=375$
    RewriteRule (.*)  http://www.example.org/content/MyNewPage?  [R=301,L]
    

提交回复
热议问题