K
K
kentos2020-06-25 10:00:06
Web servers
kentos, 2020-06-25 10:00:06

How to make such a redirect with dynamic parameters?

How to make such a redirect?

https://dpos.space/randomblockchain/?chain=viz&blo... - https://dpos.space/viz/randomblockchain/?block1=35...
(as you understand, instead of viz there can be golos, steem. Instead values ​​of GET parameters may be different).

I tried to implement something like this:
RewriteCond %{QUERY} ^chain=(.*)$&block1=(.*)$&block2=(.*)$?&participants=(.*)$ [NC]
And then stuck

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dodo512, 2020-06-25
@dodo512

RewriteCond %{QUERY_STRING} ^(|.*?&)chain=([^&]+)&?(.*)
RewriteRule ^randomblockchain/$ https://dpos.space/%2/randomblockchain/?%1%3 [R=301,L]

N
Nadim Zakirov, 2020-06-25
@zkrvndm

I'm not good at htaccess redirects, but what's stopping you from doing redirects in JavaScript?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question