douwen1313 2017-01-07 18:34
浏览 29
已采纳

使用.HTAccess从URL中删除?id = [关闭]

I have a page

root/pages/?id=webdesign

and I want to translate it into something like

root/pages/webdesign
  • 写回答

1条回答 默认 最新

  • dty5753 2017-01-07 23:03
    关注

    To keep the prefix and replace the last part with a query string

    RewriteCond %{QUERY_STRING} !^id=
    RewriteRule ^root/pages/(.+)$ /root/pages/?id=$1 [L]
    

    The RewriteCond is needed to prevent a rewrite loop.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?