我遇到一个奇怪的问题,即在我的网站上从安全支付网关回拨到安全(https://)页面后,我收到的查询字符串值不正确。这是PHP的$_SERVER
变量的内容:
Array
(
[SERVER_SOFTWARE] => Apache/2.4.9 (Unix)
[REQUEST_URI] => /sign-up/?gfsagepay_return=bGVhZF9pZD0yMDE5Jmhhc2g9ZWZlNWI3ZmIxNjVhNDVkZmIzMDY2ODBiMzcwOThhZjY
[PATH] => /usr/local/bin:/usr/bin:/bin
[REDIRECT_STATUS] => 200
[UNIQUE_ID] => VE50xX8AAAEAABWSAuMAAAAh
[HTTPS] => on
[SCRIPT_URL] => /sign-up/
[SCRIPT_URI] => http://www.domain.co.uk/sign-up/
[HTTP_HOST] => www.domain.co.uk
[HTTP_CACHE_CONTROL] => max-age=0
[HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
[HTTP_USER_AGENT] => Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_0) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/38.0.2125.104 Safari/537.36
[HTTP_REFERER] => https://live.sagepay.com/gateway/service/cardselection?vpstxid={08D220FE-1BD0-0B60-4670-A359B31465B4}
[HTTP_ACCEPT_ENCODING] => gzip,deflate,sdch
[HTTP_ACCEPT_LANGUAGE] => en-US,en;q=0.8
[HTTP_COOKIE] => wp-settings-5=editor%3Dtinymce%26libraryContent%3Dbrowse; wp-settings-time-5=1413364146; wordpress_test_cookie=WP+Cookie+check; wordpress_logged_in_0293e473decb4ad0ae4f16569dce74a6=matt%7C1414580241%7Ccc0bdf718d4ab94b2cd21206b75ed52a; _gat=1; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7_Cook_VisitorID=d40f8cd2-bd27-4c21-a2bd-83dab0637710; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7_Cook_DTS=27/Oct/14%2016%3A32%3A57; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7_Cook_ServerGUID=5B1C1DCB-07EA-45E1-91C7-BDC96AF8EE98; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7_Cook_Visits=6; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7_Cook_ExtSets=27/Oct/14%2016%3A32%3A57%7Chttps%3A//prod3si.click4assistance.co.uk%7Chttps%3A//prod3ci.click4assistance.co.uk%7CTrue%7CTrue%7CFalse%7CTrue%7CTrue%7C5%7C10%7C20%7CTrue%7CTrue%7CFalse%7C30; _ga=GA1.3.1269087434.1413364095; C4ATBCookie380b0a7e-5814-4897-a71d-e720dca390b7C4ATBTestP=Y
[HTTP_X_PROTO] => SSL
[HTTP_CONNECTION] => close
[SERVER_SIGNATURE] => <address>Apache/2.4.9 (Unix) Server at www.crb-checkonline.co.uk Port 80</address>
[SERVER_NAME] => www.domain.co.uk
[SERVER_ADDR] => 10.0.1.55
[SERVER_PORT] => 80
[REMOTE_ADDR] => 81.152.144.31
[DOCUMENT_ROOT] => /home/sites/domain.co.uk/public_html
[REQUEST_SCHEME] => http
[CONTEXT_PREFIX] =>
[CONTEXT_DOCUMENT_ROOT] => /home/sites/domain.co.uk/public_html
[SERVER_ADMIN] => root@localhost
[SCRIPT_FILENAME] => /home/sites/domain.co.uk/public_html/index.php
[REMOTE_PORT] => 34353
[REDIRECT_QUERY_STRING] => /sign-up/
[REDIRECT_URL] => /sign-up/
[GATEWAY_INTERFACE] => CGI/1.1
[SERVER_PROTOCOL] => HTTP/1.1
[REQUEST_METHOD] => GET
[QUERY_STRING] => /sign-up/
[SCRIPT_NAME] => /index.php
[PHP_SELF] => /index.php
[REQUEST_TIME] => 1414427845
)
我期待QUERY_STRING
值为:
gfsagepay_return=bGVhZF9pZD0yMDE5Jmhhc2g9ZWZlNWI3ZmIxNjVhNDVkZmIzMDY2ODBiMzcwOThhZjY
但是它是:
/sign-up/
$_GET
的内容证实了这种奇怪之处:</ p>
Array
(
[/sign-up/] =>
)
我也很惊讶REQUEST_SCHEME
值为http
而非https
,尽管我已经读过这并不总是可靠的。
这看起来像是SSL配置错误,还是我的脚本中的其他内容会影响它?
此致
太
PS。作为参考,根.htaccess文件如下所示:
RewriteEngine on
RewriteBase /
RewriteCond %{ENV:HTTPS} !on [NC]
RewriteRule ^(.*)$ https://www.domain.co.uk/$1 [R,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [PT,L]
Options -Indexes