0

I'm having trouble rewriting this URL below:

https://domain-name.com/2020/10/title_of_article.html?id=1

into:

https://domain-name.com/0/1

  • the year is unnecessary so it is removed/truncated/ignored
  • the month is unnecessary so it is removed/truncated/ignored
  • the title is also unnecessary, so it is removed/truncated/ignored
  • an additional "/0" is inserted right after domain name
  • the "id=1" becomes the "/1"

to send into the application server.

Can someone help me to give me the regex (or whatever) for nginx to work? Should I be using the http rewrite module, or it can be done with plain settings? I'm stuck. Please help. Thanks!

ikevin8me
  • 137
  • 1
  • 6

0 Answers0