的WordPress的子目錄我的控制之外的原因,我需要得到一個Laravel實例中運行的IIS裏面10.我已經盡我的web.config配置<system.webServer><rewrite><rules />
裏面每一個可能的選項的WordPress的子目錄,但我只能得到一個或另一個工作。如果我將重寫規則留在WordPress中,Laravel不起作用(WordPress使用404響應),如果我禁用WordPress規則,Laravel可以正常工作,但顯然WordPress不支持。配置Laravel作爲IIS
這裏是在站點的根目錄(如WordPress的坐)的配置:它讓我把一個嵌套的web.config中
<rewrite>
<rules>
<rule name="WordPress" patternSyntax="Wildcard">
<match url="*" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<!-- Laravel App -->
<add input="{REQUEST_URI}" pattern="^/laravel" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
由於採用了SO搜索,我碰到這個來(IIS Url Rewrite not working with nested WP installs)的子文件夾Laravel應用程序有以下:
<rewrite>
<rules>
<clear />
<rule name="Imported Rule 2" stopProcessing="true">
<match url="/(.*)$" ignoreCase="false" />
<conditions logicalGrouping="MatchAll">
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="public/index.php/{R:1}" />
</rule>
</rules>
</rewrite>
奇怪的是,這些它幾乎作品 - 只要我去site.com/laravel/public,所有相關工作的意見和一切戲劇很好ogether。我似乎無法取得URL的/ public,顯然這是不可用的。
任何提示?我確定它很接近,但我無法弄清楚。