开发者

.htaccess question : Can I strip out a leading question mark?

I have a page that already has the $_GET array initialized, a开发者_如何学编程nd when a page redirects there (with an oAuth token) it appends the ?token=36264747 to the end.

Is there a way to write an .htaccess file for an Apache server that would either strip that question mark or (better) replace it with an ampersand?


You need the qsappend or QSA (query string append) flag for RewriteRule:

RewriteRule ^foo(.*)bar$ index.php?token=$1 [QSA]

will append token=$1 to the query string (the $_GET part), using ? or & as appropriate.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜