.htaccess到web.config iis的发布路由

时间:2019-01-07 01:09:10

标签: .htaccess iis web-config web.config-transform

晚安。我在php/apache中有一个站点,路由配置文件为.htaccess。我需要将该站点传递给azure平台web.config,但是,我无法在IIS中使用路由。我对网站的工作原理进行了说明。

enter image description here

我想隐藏.php扩展名并使路由正常工作100%。网址https://mysite.azurewebsites.net/notify/f/43有2个变量:f43

我在.htaccess目录中的第一个\wwwroot\site文件和我在.htaccess目录中的第二个folder_1文件是:(它们相同)

<IfModule mod_rewrite.c>

RewriteEngine on

# If a script is called without .php extension, but with /variables
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^([a-zA-Z0-9\\._-]*)?/(.*)$ $1.php/$2 [QSA,E=PATH_INFO:/$2,L]

# If a script is called without .php extension, and without /variables
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^(.*)$ $1.php [QSA,L]

# Fix PHP Authentication with FastCGI mode
RewriteCond %{HTTP:Authorization} !''
RewriteRule .*php - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]

</IfModule>

非常感谢您的关注。我希望能有所回应。 =)

0 个答案:

没有答案