网址改写查询字符串,从问号到斜杠

时间:2018-10-22 08:11:43

标签: url-rewriting query-string

我要重写此网址:

https://www.myproblem.com/OAuth?code=AQC7EYXImGt-r0h_AgldRo6D78it4CSdzrrB9Z455oQ-&state=HA-XVSDdzzSF41

收件人:

this.http.get(this.url).pipe(
    map((clients) => clients.map((client) => ({ ...new Client(), ...client})) 
  )
  .subscribe(
      (clients) => {
        console.log(clients[0]) // this works and shows the client info
        console.log(clients[0].getName());
});

我尝试了很多不同的重写规则,并在https://htaccess.madewithlove.be/上对其进行了测试,但是找不到任何解决方案...

我尝试过这样的事情:

https://www.myproblem.com/OAuth/code/AQC7EYXImGt-r0h_AgldRo6D78it4CSdzrrB9Z455oQ-/state/HA-XVSDdzzSF41

RewriteCond %{QUERY_STRING} ^code=([a-zA-Z0-9_\-]+)&state=([a-zA-Z0-9_\-]+)$
RewriteRule ^/OAuth(.*)/$ /OAuth/code/%1/state/%2?

但这不起作用。...

0 个答案:

没有答案