mod_rewriteのRewriteRuleでクエリを引き継ぎたい場合は、QSAフラグが使えることを最近知りました。 たとえば次のようなURLをリクエストします。 http://example.com/status/fkoji?count=10 サーバ側で定義している RewriteRule は次のようなものです。 RewriteRule /([^/]+)/([^/]+) index.php?controller=$1&user_name=$2 [L] この場合、リライト後のURLは、 http://example.com/index.php?controller=status&user_name=fkoji となって元々存在していた count クエリが消えてしまって困ります。 こういう場合にQSAフラグを使うことができます。 RewriteRule /([^/]+)/([^/]+)
![mod_rewriteでURLのクエリを引き継いでリライトするRewriteRuleの書き方 - F.Ko-Jiの「一秒後は未来」](https://cdn-ak-scissors.b.st-hatena.com/image/square/49bc6ff267b075ca4e583d1b7a0fc5db18dae524/height=288;version=1;width=512/http%3A%2F%2Fblog.fkoji.com%2Fwp-content%2Fuploads%2F2017%2F01%2Ffkoji-twitter-icon.png)