PHPのheaderのlocationについて教えてください。
php
1$url = "http://example.com?a=1111&b=2222"; 2header("location: {$url}");
とした時に、実際のリダイレクトしている時のヘッダーを見てみると
http://example.com/?a=111&b=222
とURLエンコードしたものにリダイレクトしているようです。
これをURLエンコードしてない http://example.com?a=1111&b=2222
へリダイレクトする方法はありますでしょうか。
以下ヘッダーです。
header
1Response 2HTTP/1.1 302 Found 3Connection: close 4Date: Wed, 01 Feb 2017 04:34:48 GMT 5Location: http://example.com/?a=111&b=222 6Server: Apache/2.2.15 (CentOS) 7Content-Length: 0 8Content-Type: text/html; charset=pass 9Client-Date: Wed, 01 Feb 2017 04:34:47 GMT 10Client-Response-Num: 1 11X-Powered-By: PHP/5.3.10
確認はこちらのページで行いました。
https://www.searchengineoptimization.jp/redirect-checker
よろしくお願いいたします。
環境
php 5.3.10
Server: Apache/2.2.15 (CentOS)
回答3件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/02/01 06:39