HTAccess - Confusing clean url's

后端 未结 2 372
野趣味
野趣味 2021-01-27 17:32

If i wanted to simply redirect /clients/page/ to /clients.php?view=page i would use something as simple as this, it works great.

Option         


        
相关标签:
2条回答
  • 2021-01-27 17:48

    I think you're looking for the [QSA] flag on the RewriteRule:

    http://httpd.apache.org/docs/2.0/mod/mod_rewrite.html#RewriteRule

    That should cause mod_rewrite to preserve your original query parameters.

    RewriteRule ^clients/([^/]+) /clients.php?section=$1 [QSA,NC]
    
    0 讨论(0)
  • 2021-01-27 17:52

    I think you can use the [QSA] flag, which stands for Query String Append. This means that you can add variables to the Query String easily:

    RewriteRule ^clients/([^/]+) /clients.php?section=$1 [QSA, NC]
    
    0 讨论(0)
提交回复
热议问题