問(wèn)題描述
我想設(shè)置我的 IIS7
服務(wù)器,以便讓它與用 laravel
(php 框架)編寫的 Web 應(yīng)用程序一起工作.
I want to set up my IIS7
server in order to let it works with a web application written in laravel
(php framework).
我發(fā)現(xiàn)了類似 CI
的東西(鏈接)
I found something similar for CI
(link)
但它在 laravel
上不起作用(當(dāng)然我刪除了 index.php
重定向).
but it doesn't work on laravel
(of course I removed the index.php
redirection).
實(shí)際上只有主頁(yè)有效(www.mysite.com/public
)
actually only home page works (www.mysite.com/public
)
有人在 Laravel 中使用/d IIS7
嗎?
anybody uses/d IIS7
with Laravel?
提前致謝
推薦答案
我在
根文件夾中創(chuàng)建了 web.config
文件>:
<system.webServer>
<defaultDocument>
<files>
<clear />
<add value="index.php" />
<add value="default.aspx" />
<add value="Default.htm" />
<add value="Default.asp" />
<add value="index.htm" />
<add value="index.html" />
</files>
</defaultDocument>
<handlers accessPolicy="Read, Execute, Script" />
<rewrite>
<rules>
<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/{R:1}" />
</rule>
</rules>
</rewrite>
</system.webServer>
然后將public文件夾的index.php
文件復(fù)制到項(xiàng)目的根文件夾中修改../paths.php
到paths.php
正如本指南所說(shuō)
then copy the index.php
file of the public folder into the root folder of the project modifying the ../paths.php
into paths.php
as this guide says
現(xiàn)在一切正常
這篇關(guān)于在 IIS7 上設(shè)置 Laravel的文章就介紹到這了,希望我們推薦的答案對(duì)大家有所幫助,也希望大家多多支持html5模板網(wǎng)!