.htaccess to web.config iis issues route

2019-08-02 06:21发布

问题:

Good night. I have a site in php/apache and the file of configurations of routes is the .htaccess. I need pass the site to azure plataform web.config But, I can not work the routes in the IIS. I did a schematic of how the site works.

I want to hide the .php extension and make the route work 100%. The url https://mysite.azurewebsites.net/notify/f/43 has 2 variables: f and 43.

My first .htaccess file from the \wwwroot\site directory and my second .htaccess file from folder_1 directory is: (they are the same)

<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>

Thank you very much for the attention. I look forward to having some response. =)