0
我有一个.net面板托管的Laravel应用程序,如果安装在根目录下,它工作正常。但是我必须在根目录后面的两个子目录中使用它,即它安装在root/dir1/dir2/app中。现在下面是我目前在web.config文件中的代码,如果应用程序直接安装在根目录下的正常工作:如何在web.config文件中重写URL以隐藏url中的index.php,例如http://demo.example.com/dir/dir/index.php/login?
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Move to index.php">
<match url=".*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
</conditions>
<action type="Rewrite" url="index.php/{R:0}" logRewrittenUrl="true" />
</rule>
</rules>
</rewrite>
<httpProtocol>
<customHeaders>
<add name="X-UA-Compatible" value="IE=11" />
</customHeaders>
</httpProtocol>
</system.webServer>
</configuration>
所以,目前,http://demo.example.com/dir1/dir2/index.php/login的作品,但我需要它像http://demo.example.com/dir1/dir2/login,是有可能吗?如果是这样,请尽可能解释您的答案。 谢谢。