2013-02-22 19 views

Odpowiedz

8

Możesz użyć import Apache rules feature do przekształcenia reguły Apache na IIS.

W twoim przypadku, to pójdzie jak:

import

lub w pliku web.config:

<rule name="Imported Rule 1" stopProcessing="true"> 
    <match url="^" ignoreCase="false" /> 
    <conditions logicalGrouping="MatchAll"> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" ignoreCase="false" negate="true" /> 
    </conditions> 
    <action type="Rewrite" url="index.php" /> 
</rule> 
+0

bardzo przydatne, dzięki. –

+0

@jcadiz, jak dodać ten kod i gdzie w miejscu publicznym lub w htacess. Proszę pomóż –

2

Istnieje kilka dodatkowych odcinków, które warto umieszczenie w internecie. plik konfiguracyjny

Poniższy kod umożliwia tworzenie restfull kontrolerów za pomocą dodatkowych czasowników HTTP PUT i DELETE oraz s dla niestandardowych stron błędów laravel, który ma być wyświetlany podczas remotley debugowania serwera:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="Laravel4" stopProcessing="true"> 
        <match url="^" ignoreCase="false" /> 
        <conditions logicalGrouping="MatchAll"> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" appendQueryString="true" /> 
       </rule> 
      </rules> 
     </rewrite> 
     <handlers> 
      <remove name="PHP53_via_FastCGI" /> 
      <add name="PHP53_via_FastCGI" path="*.php" verb="GET,HEAD,POST,PUT,DELETE" modules="FastCgiModule" scriptProcessor="C:\Program Files (x86)\PHP\v5.3\php-cgi.exe" resourceType="Either" requireAccess="Script" /> 
     </handlers> 
     <httpErrors errorMode="Detailed" /> 
    </system.webServer> 
</configuration> 
4

ten pracował dla mnie, dzięki Oli Folkerd:

<?xml version="1.0" encoding="utf-8"?> 
<configuration> 
    <system.webServer> 
     <rewrite> 
      <rules> 
       <rule name="Laravel4" stopProcessing="true"> 
        <match url="^" ignoreCase="false" /> 
        <conditions logicalGrouping="MatchAll"> 
         <add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" /> 
         <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 
        </conditions> 
        <action type="Rewrite" url="index.php" appendQueryString="true" /> 
       </rule> 
      </rules> 
     </rewrite> 
    </system.webServer> 
</configuration> 
Powiązane problemy