nginx重写规则小写到大写+标记结尾?

时间:2019-03-03 17:06:45

标签: nginx url-rewriting

我需要这些网址的重写规则:

/ blog / big-green-blog-entry-with-tag / xydf07bz5tnpqzh / ?tag = this-blog-49

转换后的URL具有以下结构:

  • /博客/
    不动态
  • big-green-blog-entry-with-tag /
    =动态文字,但与重写规则无关的文字应该被剪掉
  • xydf07bz5tnpqzh /
    =必须始终以大写形式转换动态字符串
  • ?tag = this-blog-49 =是动态字符串,应附加在末尾

    1. 示例:
      来自:
      / blog / big-green-blog-entry-with-tag / xydf07bz5tnpqzh /?tag = this-blog-49
      收件人:
      https://www.myblog.de/id/XYDF07BZ5TNPQZH/?tag=this-blog-49

    2. 示例:
      来自:
      / blog / another-blog-entry-with-tag / abtgf567d /?tag = new-blog-32
      收件人:
      https://www.myblog.de/id/ABTGF567D/?tag=new-blog-32

到目前为止,我的规则:
rewrite ^/blog/[a-zA-Z0-9-_]+/([a-zA-Z0-9-_]+)/ https://www.myblog.de/id/$1/? redirect;

有人可以帮助我吗?

谢谢!

0 个答案:

没有答案