我在 html 中生成了以下网址
http://www.xxx.com/page/26/website-design-services?ajax=true
配置 .htaccess 语法来读取页面 id 的值是
# BEGIN Rewrite
<IfModule mod_rewrite.c>
RewriteEngine on
#RewriteBase /
RewriteRule ^page/([^/]+)/?(.*)$ page.php?section=$1 [QSA,L]
</IfModule>
# END Rewrite
当我调用 php 文件进行如下获取时,它仅返回 GET 数组中的 ajax 部分。见下文 page.php
print_r($_GET);
$url = $_GET['section'];
输出是
Array
(
[ajax] => true
)
知道为什么它没有检测到其他变量吗?