目前,Uni 只提供了一个IIS 服务器来托管我们的php 网站,我们想使用Laravel 框架,它在主页上运行。但不是在任何其他 Controller 上。
我的公用文件夹中的当前 web.config
是,
<configuration>
<system.webServer>
<rewrite>
<rules>
<rule name="Imported Rule 1" stopProcessing="true">
<match url="^(.*)/$" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="/{R:1}" />
</rule>
<rule name="Imported Rule 2" stopProcessing="true">
<match url="^" ignoreCase="false" />
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" ignoreCase="false" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" />
</conditions>
<action type="Rewrite" url="index.php" />
</rule>
</rules>
</rewrite>
</system.webServer>
</configuration>
我的路线是,
Route::get('/', function () {
return view('welcome');
});
Auth::routes();
Route::get('/home', 'HomeController@index')->name('home');
我对 IIS 不是很了解,所以您有什么想法来配置它以使其工作吗?
附言
我们没有权限在营地配置IIS服务器,我们有权限做的是上传web.config
。
提前致谢。
最佳答案
关于php - IIS 服务器,如何为 Laravel 5 配置 url 重写?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50561072/