RedirectMatch not working in htaccess

后端 未结 1 1895
日久生厌
日久生厌 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)
提交回复
热议问题