iis7 安裝laravel5.4環境
阿新 • • 發佈:2017-05-13
cond front direct port com .config art pac multiview
laravel版本: Laravel5.4
IIS版本:IIS7
站點配置就不詳細說啦,大家網上可以搜一坨很多的配置方法啦哈
直接上圖:
由於IIS沒有像Apache.htaccess文件,創建一個Web.config文件在 D:\www\clw_app\public 下面
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>
大家如果是apache環境,那麽public目錄下的.htaccess是:
<IfModule mod_rewrite.c> <IfModule mod_negotiation.c> Options -MultiViews </IfModule> RewriteEngine On # Redirect Trailing Slashes If Not A Folder... RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)/$ /$1 [L,R=301] # Handle Front Controller... RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^ index.php [L] # Handle Authorization Header RewriteCond %{HTTP:Authorization} . RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] </IfModule>
我這裏是運行滴iis環境(暫且咱不說apache額)
iisreset /restart
在IIS中如果W3SVC服務沒有運行,可以開始用下面的命令:
net start w3svc
最終運行效果:
iis7 安裝laravel5.4環境