假设网址:
https://a.com/2.0.0.0/article/10.1/zh-CN/a.json
,我要映射的物理路径是c:/program/2.0/a.json
,
和网址:
https://a.com/2.1.0.0/blog/11/zh-CN/b.json
,我要映射的物理路径是c:/program/2.1/b.json
,并按照上述规则进行映射。
如果是Nginx或Apache,则可以很好地配置它。 Nginx是:
location ~ ^/(\d\d?\.\d\d?).+/(.+\.json)$ {
try_files $uri /program/$1/$2;
}
Apache可以是:
AliasMatch ^/(\d\d?\.\d\d?).+/(.+\.json)$ C:/program/$1/$2
<Directory "C:/program">
AllowOverride All
Order allow,deny
Allow from all
Require all granted
</Directory>
有人知道如何配置IIS吗?预先感谢。