任何工具/实用程序重写html页面中的URL
我开始特别在nginx中使用lua。我需要重写中的网址,例如< a href =http://toberewritten.com> link1< / a>
应改写为< a href =http://rewritten.com> link1< / a>
I am beginning to use lua especially with nginx. I need to rewrite the URLs within the html page i.e. let's say <a href="http://toberewritten.com">link1</a>
should be rewritten to <a href="http://rewritten.com">link1</a>
https://github.com/wscherphof/lua-htmlparser上的lua html解析器提供的网址,但据我的理解,它不会重写URL。我可以重建页面,但是想知道是否已经有一个工具可以做到这一点。
The lua html parser at https://github.com/wscherphof/lua-htmlparser provides the URL but as far as I understand from its documentation, it will not rewrite the URL. I can perhaps reconstruct the page but was wondering if there is already a tool that would do that
感谢您的任何意见
Thanks for any inputs
您可以尝试 https:// github .com / agentzh / replace-filter-nginx-module
location / {
# caseless global substitution:
replace_filter 'toberewritten' 'rewritten' 'ig';
replace_filter_types text/plain text/css;
}