私はURLを持っています
api/something/json?callback=abc にリダイレクトしたい
dothis.php?strEndPoint=something&callback=abc&format=json
私が試した基本htaccessは次のとおりです。
RewriteRule ^api/(. )/(json)?callback=(. ) client.php?strEndPoint=$1&callback=$3&format=($2)
動作していないようです:p
私はURLを持っています
api/something/json?callback=abc にリダイレクトしたい
dothis.php?strEndPoint=something&callback=abc&format=json
私が試した基本htaccessは次のとおりです。
RewriteRule ^api/(. )/(json)?callback=(. ) client.php?strEndPoint=$1&callback=$3&format=($2)
動作していないようです:p
テスト済み
を使用しています。
RewriteEngine On
RewriteCond %{QUERY_STRING} callback\=(.*)
RewriteRule /api/(.*)/(json) /client.php?strEndPoint=$1&callback=%1&format=$2 [R=301]
テストのためだけに r=301 を削除できます
$ curl localhost/api/1111/json?callback=2222 -I
HTTP/1.1 301 Moved Permanently
Date: Fri, 01 Nov 2013 03:16:25 GMT
Server: Apache/2.2.24 (Unix) DAV/2 mod_ssl/2.2.24 OpenSSL/0.9.8y
Location: http://localhost/client.php?strEndPoint=1111&callback=2222&format=json