晚安。我在php/apache
中有一个站点,路由配置文件为.htaccess
。我需要将该站点传递给azure
平台web.config
,但是,我无法在IIS中使用路由。我对网站的工作原理进行了说明。
我想隐藏.php扩展名并使路由正常工作100%。网址https://mysite.azurewebsites.net/notify/f/43
有2个变量:f
和43
。
我在.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>
非常感谢您的关注。我希望能有所回应。 =)