Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/.htaccess/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 如何在IIS/web.config中重写仍然显示键入的/pretty URL?_Wordpress_.htaccess_Iis_Web Config_Azure Web App Service - Fatal编程技术网

Wordpress 如何在IIS/web.config中重写仍然显示键入的/pretty URL?

Wordpress 如何在IIS/web.config中重写仍然显示键入的/pretty URL?,wordpress,.htaccess,iis,web-config,azure-web-app-service,Wordpress,.htaccess,Iis,Web Config,Azure Web App Service,我有这样一个htaccess规则: 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] 这样可以允许类似以下URL的URL: site.com/page/pretty/some-pretty-page-ABCD 要在以下位置显示页面: site.c

我有这样一个
htaccess
规则:

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]
这样可以允许类似以下URL的URL:

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

无需重定向/更改地址栏中的URL。我如何在Azure/IIS/web.config中实现同样的功能?

您需要的是反向代理实现。这可以通过使用ARRURL重写模块来实现。请参阅本文,讨论如何实现此配置: