Access GET variables with PHP + .htaccess

前端 未结 1 1393
花落未央
花落未央 2020-12-11 09:13

I\'m developing a website using PHP. My .htaccess has this rewrite rule:

RewriteEngine On
RewriteRule ^book/([^/]*)\\.html$ book.php?title=$1 [L]

1条回答
  •  谎友^
    谎友^ (楼主)
    2020-12-11 09:54

    Specify [QSA] (Query string append) so you may pass a query string after your url.

    RewriteEngine On
    RewriteRule ^book/([^/]*)\.html$ book.php?title=$1 [QSA,L]
    

    PS: Why are you using * here? Wouldn't + suit better?

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