Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.0k views
in Technique[技术] by (71.8m points)

url rewriting - Azure CDN rules engine to rewrite default document and remove .html extension

I would like to use azure blob and CDN premium features but the documentation is very sparse. This is something totally doable on Amazon S3 / CloudFront.

For clarity I want *.azureedge.net/sample/index.html to equal*.azureedge.net/sample/ and *.azureedge.net/sample/test.html to equal to *.azureedge.net/sample/test

This is totally not clear and takes "up to 4 hours" to preview changes, so...

azure rules engine

After some investigation, Azure has a wrapper for Verizon Edgecast CDN, and this page looks identical to theirs...

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Edgecast support gave me the following rules:

enter image description here

  • add a new rule IF Always
    • Feature
      • URL Rewrite - source ((?:[^?]*/)?)($|?.*) destination $1index.html$2
      • URL Rewrite - source ((?:[^?]*/)?[^?/.]+)($|?.*) destination $1.html$2

I created an npm package to deploy a folder and subfolders to azure storage see https://github.com/glued/yokai theres some additional information about configuring the CDN for clean urls here: https://github.com/glued/yokai/blob/master/azure.md


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...