【发布时间】:2011-03-23 11:39:36
【问题描述】:
我正在使用 PHP 开发一个网站。 我的 .htaccess 有这个重写规则:
RewriteEngine On
RewriteRule ^book/([^/]*)\.html$ book.php?title=$1 [L]
所以 URL 看起来像:www.example.com/book.php?title=title-of-the-book 变成 www.example.com/book/title-of-the-book.html
在特定情况下,我想从网站的另一个页面链接到这样的页面: www.example.com/book.php?title=title-of-the-book?myfield=1 然后变成 www.example.com/book/title-of-the-book.html?myfield=1.html
在那里,我无法使用通常的 PHP 方式访问 GET 变量
$variable = $_GET['myfield']
我该如何解决这个问题?
【问题讨论】:
标签: php .htaccess url-rewriting get