Is it possible to dynamically redirect URL using htaccess?

Is there any way to dynamically redirect URLs. For example, I want to redirect any URL fromto https:examplecom?p=NN

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.

Share Improve this question edited Apr 1, 2019 at 17:11 MrWhite 3,8911 gold badge20 silver badges23 bronze badges asked Apr 1, 2019 at 5:10 Avinash PatelAvinash Patel 398 bronze badges 1
  • Redirect or rewrite? – Krzysiek Dróżdż Commented Apr 1, 2019 at 6:37
Add a comment  | 

1 Answer 1

Reset to default 2

StackOverflow 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]

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745636538a4637429.html

相关推荐

  • Is it possible to dynamically redirect URL using htaccess?

    Is there any way to dynamically redirect URLs. For example, I want to redirect any URL fromto https:examplecom?p=NN

    21天前
    40

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信