.htaccess to web.config iis issues route

自古美人都是妖i 提交于 2019-12-11 07:19:35

问题


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. =)

来源:https://stackoverflow.com/questions/54067459/htaccess-to-web-config-iis-issues-route

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!