RedirectMatch not working in htaccess

后端 未结 1 1899
日久生厌
日久生厌 2021-01-27 08:08

Iam trying to to redirect my page from

from http://domain.com/article.php?id=23232 to http://domain.com/article/23232

am using thi

1条回答
  •  星月不相逢
    2021-01-27 08:40

    You cant match query string using RedirectMatch. Use mod_rewrite rules instead:

    RewriteCond %{QUERY_STRING} ^id=([^&]*)
    RewriteRule ^article\.php$ http://domain.com/article/%1? [L,R=301,NC]
    

    0 讨论(0)
提交回复
热议问题