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,是有可能嗎?如果是這樣,請儘可能解釋您的答案。 謝謝。