Is there any way to dynamically redirect URLs. For example, I want to redirect any URL from to
https://examplecom/?p=NNNNN
.
Where NNNNN
could be any possible numbers.
For example: should redirect to
/?p=1796
.
Is there any way to dynamically redirect URLs. For example, I want to redirect any URL from https://example/NNNNN
to https://examplecom/?p=NNNNN
.
Where NNNNN
could be any possible numbers.
For example: https://example/1796
should redirect to https://example/?p=1796
.
- Redirect or rewrite? – Krzysiek Dróżdż Commented Apr 1, 2019 at 6:37
1 Answer
Reset to default 2StackOverflow has already an answer for your question: https://stackoverflow/questions/2551553/htaccess-redirecting-dynamic-url
I guess that this should do the trick:
RewriteRule ^(\d+)$ /?p=$1 [R=302,L]