最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Is it possible to dynamically redirect URL using htaccess?

programmeradmin1浏览0评论

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]
发布评论

评论列表(0)

  1. 暂无评论