2017-06-19 35 views
0

我有一个htaccess规则是这样的:如何在IIS/web.config中重写仍然显示类型化/漂亮的URL?

RewriteRule ^page/pretty/([A-Za-z0-9\-]+)-(.[A-Za-z0-9]*)/?$ /page/pretty/prettytemplatepage/?code=$2&path=page/pretty/$1-$2&slug=$1-$2 [P,L] 

这个工作,让像一个网址:

site.com/page/pretty/some-pretty-page-ABCD 

要在显示页面:

site.com/page/pretty/prettypagetemplate/?code=ABCD&path=page/pretty/some-pretty-page-ABCD&slug=some-pretty-page-ABCD 

没有重定向/改变地址栏中的网址。我如何在Azure/IIS/web.config中完成同样的事情?

回答